Only comment code added #10

Merged
merged 2 commits into from Nov 1, 2012
Jump to file or symbol
Failed to load files and symbols.
+9 −1
Split
@@ -124,7 +124,7 @@ def _text_repl(self, groups):
text = groups.get('text', "")
if groups.get('space'):
- # use wiki style line breaks and seperate a new line with one space
+ # use wikipedia style line breaks and seperate a new line with one space
text = " " + text
self.parse_inline(text)
@@ -19,11 +19,19 @@ class InlineRules(object):
All inline rules
"""
proto = r'http|https|ftp|nntp|news|mailto|telnet|file|irc'
+ # New regex for finding uris, requires uri to free stand within whitespace or lineends.
url = r'''(?P<url>
(^ | (?<=\s))
(?P<escaped_url>~)?
(?P<url_target> (?P<url_proto> %s )://[^$\s]+ )
)''' % proto
+ # Original uri matching regex inherited from MoinMoin code.
+ #url = r'''(?P<url>
+ #(^ | (?<=\s | [.,:;!?()/=]))
+ #(?P<escaped_url>~)?
+ #(?P<url_target> (?P<url_proto> %s ):\S+? )
+ #($ | (?=\s | [,.:;!?()] (\s | $)))
+ #)''' % proto
link = r'''(?P<link>
\[\[
(?P<link_target>.+?) \s*