Merge commit 'giskard/master'
authorBernie Innocenti <bernie@codewiz.org>
Fri, 19 Mar 2010 13:12:37 +0000 (09:12 -0400)
committerBernie Innocenti <bernie@codewiz.org>
Fri, 19 Mar 2010 13:12:37 +0000 (09:12 -0400)
1  2 
geekigeeki.py

diff --combined geekigeeki.py
index 3ae59e03d1dd33c0044e57ed669c9149d2665bc1,a5ba6a2d388565ae9ac3f5dff29ca48f8126fb50..494118661918794e5726000858eabe9db891023d
@@@ -25,7 -25,7 +25,7 @@@ video_ext = "ogg|ogv|oga" # Not support
  image_re = re.compile(r".*\.(" + image_ext + "|" +  video_ext + ")$", re.IGNORECASE)
  video_re = re.compile(r".*\.(" + video_ext + ")$", re.IGNORECASE)
  # FIXME: we accept stuff like foo/../bar and we shouldn't
 -file_re  = re.compile(r"([A-Za-z0-9_\-][A-Za-z0-9_\.\-/]*)$")
 +file_re  = re.compile(r"([A-Za-z0-9_\-][A-Za-z0-9_\.\-/ ]*)$")
  url_re   = re.compile(r"[a-z]{3,8}://[^\s'\"]+\S$")
  ext_re   = re.compile(r"\.([^\./]+)$")
  
@@@ -556,8 -556,8 +556,8 @@@ class WikiFormatter
              | (?P<glyph> --)
  
              # Links
 -            | (?P<macro> \<\<([^\s\|\>]+)(?:\s*\|\s*([^\>]+)|)\>\>)
 -            | (?P<hurl>  \[\[([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\]\])
 +            | (?P<macro> \<\<[^\>]+\>\>)
 +            | (?P<hurl>  \[\[[^\]]+\]\])
  
              # Inline HTML
              | (?P<html>             <(br|hr|div|span|form|iframe|input|textarea|a|img|h[1-5])\b )
              # Lists, divs, spans and inline objects
              | (?P<li>    ^\s+[\*\#]\s+)
              | (?P<pre>   \{\{\{|\s*\}\}\})
 -            | (?P<inl>   \{\{([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\}\})
 +            | (?P<inl>   \{\{[^\}]+\}\})
  
              # Tables
              | (?P<tr>    ^\s*\|\|(=|)\s*)
@@@ -667,16 -667,17 +667,17 @@@ class Page
              pathname = (pathname and pathname + '/' ) + dirname
              out += '[[' + pathname + '|' + dirname + ']]/'
          out += ' ==\n'
+         images_out = '\n'
   
          for filename in page_list(self._filename(), file_re):
              if image_re.match(filename):
                  maxwidth = config_get('image_maxwidth', '400')
                  if maxwidth:
                      maxwidth = ' | maxwidth=' + str(maxwidth)
-                 out += '{{' + self.page_name + '/' + filename + ' | ' + humanlink(filename) + maxwidth + ' | class=thumbleft}}\n'
+                 images_out += '{{' + self.page_name + '/' + filename + ' | ' + humanlink(filename) + maxwidth + ' | class=thumbleft}}\n'
              else:
                  out += ' * [[' + self.page_name + '/' + filename + ']]\n'
-         return out
+         return out + images_out
  
      def pragmas(self):
          if not '_pragmas' in self.__dict__: