return '<a href="%s" rel="nofollow" class="external">%s</a>' % (word, word)
def _hurl_repl(self, word):
- m = re.compile("\[\[(\S+)(?:\s*\|\s*([^\]]*)|)\]\]").match(word)
+ m = re.compile("\[\[([^ \t\n\r\f\v\|]+)(?:\s*\|\s*([^\]]+)|)\]\]").match(word)
name = m.group(1)
descr = m.group(2) or name
# Links
+ r"|(?P<img>\b[a-zA-Z0-9_-]+\.(png|gif|jpg|jpeg|bmp))"
+ r"|(?P<word>\b(?:[A-Z][a-z]+){2,}\b)"
- + r"|(?P<hurl>\[\[(\S+)(?:\s*\|\s*([^\]]*)|)\]\])"
+ + r"|(?P<hurl>\[\[([^ \t\n\r\f\v\|]+)(?:\s*\|\s*([^\]]+)|)\]\])"
+ r"|(?P<url>(http|https|ftp|mailto)\:[^\s'\"]+\S)"
+ r"|(?P<email>[-\w._+]+\@[\w.-]+)"