X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=plugins%2Flink.py;h=6b57e256b560f5fe5a220b94dc8f892e7451d345;hb=fe5970b6817eca2a96df15e9d1818485a49b3a19;hp=b0d673b306991beb4fcb17bec4940aaa8b105a07;hpb=be8c91275e22ac75d90aef2fa5f825c1d35c3492;p=webber.git diff --git a/plugins/link.py b/plugins/link.py index b0d673b..6b57e25 100644 --- a/plugins/link.py +++ b/plugins/link.py @@ -5,18 +5,18 @@ import os, re # To understand this beast, read /usr/share/doc/python2.5-doc/html/lib/module-re.html :-) reLink = re.compile(r''' - \[\[ # Begin of link - (?=[^!]) # Don't fire for macros + \[\[ # Begin of link + (?=[^!]) # Don't fire for macros (?: - ([^\]\|]+) # 1: link text - \| # followed by '|' - )? # optional - ([^\n\r\]#]+) # 2: page to link to + ([^\]\|]+) # 1: link text + \| # followed by '|' + )? # optional + ([^\n\r\]#]+) # 2: page to link to ( - \# # '#', beginning of anchor - [^\s\]]+ # 3: anchor text, doesn't contain spaces or ']' - )? # optional - \]\] # end of link + \# # '#', beginning of anchor + [^\s\]]+ # 3: anchor text, doesn't contain spaces or ']' + )? # optional + \]\] # end of link ''', re.VERBOSE) def do_link(m): @@ -55,9 +55,9 @@ def test_link(): m = reLink.search(s) if m: print "link:", s - print " name:", m.group(1) - print " link:", m.group(2) - print " anchor:", m.group(3) + print " name:", m.group(1) + print " link:", m.group(2) + print " anchor:", m.group(3) else: print "No link:", s