Permalink
Browse files

Replaced orig code, but commented, added desc

Replaced the MoinMoin code, but commented, so that devs could easily replace it if they choose to. Also added comment descriptions to the new and old regex code.
  • Loading branch information...
1 parent 8645a5a commit 0d3fb20b47d4ffc70d0f660db0579e3c48d56e33 @Sepero Sepero committed Sep 4, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 creole/creole2html/rules.py
@@ -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*

0 comments on commit 0d3fb20

Please sign in to comment.