X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=inline;f=geekigeeki.py;h=44be2a46bcc3163307d0f65d62b7421b73c130f8;hb=a8cdeeed7e87a195c5e9e0b1e2b74e6b04da1109;hp=d7e1a5a9e0d28a466e8f40b5704df5d4ea77148f;hpb=ff74de7a49cc2bfa936503a4b37fc5c8a650a5fc;p=geekigeeki.git diff --git a/geekigeeki.py b/geekigeeki.py index d7e1a5a..44be2a4 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -31,7 +31,7 @@ from os import path, environ word_re = re.compile(r"^\b((([A-Z][a-z0-9]+){2,}/)*([A-Z][a-z0-9]+){2,})\b$") # FIXME: we accept stuff like foo/../bar and we shouldn't file_re = re.compile(r"^\b([A-Za-z0-9_\-][A-Za-z0-9_\.\-/]*)\b$") -img_re = re.compile(r"^.*\.(png|gif|jpg|jpeg)$", re.IGNORECASE) +img_re = re.compile(r"^.*\.(png|gif|jpg|jpeg|bmp|ico)$", re.IGNORECASE) url_re = re.compile(r"^[a-z]{3,8}://[^\s'\"]+\S$") link_re = re.compile("(?:\[\[|{{)([^\s\|]+)(?:\s*\|\s*([^\]]+)|)(?:\]\]|}})") @@ -127,6 +127,17 @@ def send_title(name, text="Limbo", msg_text=None, msg_type='error'): print ' ' for css in css_url: print ' ' % relative_url(css) + if icon_url: + print ' ' % relative_url(icon_url) + + if privileged_url is not None: + print ' ' \ + % (privileged_path() + '?edit=' + name) + + if history_url is not None: + print ' ' \ + % (history_url + '?a=rss') + print '' # Body @@ -484,16 +495,16 @@ class WikiFormatter: + r"|(?P<(/|)(br|hr|div|form|iframe|input|span))" + r"|(?P[<>&])" - # Auto links - + r"|(?P\b[a-zA-Z0-9_/-]+\.(png|gif|jpg|jpeg|bmp))" # LEGACY - + r"|(?P\b(?:[A-Z][a-z]+){2,}\b)" # LEGACY - + r"|(?P(http|https|ftp|mailto)\:[^\s'\"]+\S)" # LEGACY - + r"|(?P[-\w._+]+\@[\w.-]+)" # LEGACY + # Auto links (LEGACY) + + r"|(?P\b[a-zA-Z0-9_/-]+\.(png|gif|jpg|jpeg|bmp|ico))" + + r"|(?P\b(?:[A-Z][a-z]+){2,}\b)" + + r"|(?P(http|https|ftp|mailto)\:[^\s'\"]+\S)" + + r"|(?P[-\w._+]+\@[\w.-]+)" # Lists, divs, spans + r"|(?P
  • ^\s+[\*#] +)" + r"|(?P
    \{\{\{|\s*\}\}\})"
    -            + r"|(?P\{\{([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\}\})" #TODO
    +            + r"|(?P\{\{([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\}\})"
     
                 # Tables
                 + r"|(?P^\s*\|\|(=|)\s*)"