Permalink
Browse files

Merge pull request #10 from Sepero/master

Only comment code added
  • Loading branch information...
2 parents e4846a3 + 146f127 commit 8d3af59c4826ad53826c46d4884bbf4cceff9eb7 @jedie committed Nov 1, 2012
Showing with 9 additions and 1 deletion.
  1. +1 −1 creole/creole2html/parser.py
  2. +8 −0 creole/creole2html/rules.py
@@ -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*

0 comments on commit 8d3af59

Please sign in to comment.