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*([^\]]+)|)(?:\]\]|}})")
print ' <meta name="robots" content="noindex,nofollow" />'
for css in css_url:
print ' <link rel="stylesheet" type="text/css" href="%s" />' % relative_url(css)
+ if icon_url:
+ print ' <link rel="icon" href="%s" />' % relative_url(icon_url)
+
+ if privileged_url is not None:
+ print ' <link rel="alternate" type="application/x-wiki" title="Edit this page" href="%s" \>' \
+ % (privileged_path() + '?edit=' + name)
+
+ if history_url is not None:
+ print ' <link rel="alternate" type="application/rss+xml" title="RSS" href="%s" />' \
+ % (history_url + '?a=rss')
+
print '</head>'
# Body
+ r"|(?P<html><(/|)(br|hr|div|form|iframe|input|span))"
+ r"|(?P<ent>[<>&])"
- # Auto links
- + r"|(?P<img>\b[a-zA-Z0-9_/-]+\.(png|gif|jpg|jpeg|bmp))" # LEGACY
- + r"|(?P<word>\b(?:[A-Z][a-z]+){2,}\b)" # LEGACY
- + r"|(?P<url>(http|https|ftp|mailto)\:[^\s'\"]+\S)" # LEGACY
- + r"|(?P<email>[-\w._+]+\@[\w.-]+)" # LEGACY
+ # Auto links (LEGACY)
+ + r"|(?P<img>\b[a-zA-Z0-9_/-]+\.(png|gif|jpg|jpeg|bmp|ico))"
+ + r"|(?P<word>\b(?:[A-Z][a-z]+){2,}\b)"
+ + r"|(?P<url>(http|https|ftp|mailto)\:[^\s'\"]+\S)"
+ + r"|(?P<email>[-\w._+]+\@[\w.-]+)"
# Lists, divs, spans
+ r"|(?P<li>^\s+[\*#] +)"
+ r"|(?P<pre>\{\{\{|\s*\}\}\})"
- + r"|(?P<inl>\{\{([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\}\})" #TODO
+ + r"|(?P<inl>\{\{([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\}\})"
# Tables
+ r"|(?P<tr>^\s*\|\|(=|)\s*)"