Skip to content

Commit

Permalink
Merge pull request #10 from Sepero/master
Browse files Browse the repository at this point in the history
Only comment code added
  • Loading branch information
jedie committed Nov 1, 2012
2 parents e4846a3 + 146f127 commit 8d3af59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion creole/creole2html/parser.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _text_repl(self, groups):
text = groups.get('text', "") text = groups.get('text', "")


if groups.get('space'): 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 text = " " + text


self.parse_inline(text) self.parse_inline(text)
Expand Down
8 changes: 8 additions & 0 deletions creole/creole2html/rules.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@ class InlineRules(object):
All inline rules All inline rules
""" """
proto = r'http|https|ftp|nntp|news|mailto|telnet|file|irc' 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> url = r'''(?P<url>
(^ | (?<=\s)) (^ | (?<=\s))
(?P<escaped_url>~)? (?P<escaped_url>~)?
(?P<url_target> (?P<url_proto> %s )://[^$\s]+ ) (?P<url_target> (?P<url_proto> %s )://[^$\s]+ )
)''' % proto )''' % 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> link = r'''(?P<link>
\[\[ \[\[
(?P<link_target>.+?) \s* (?P<link_target>.+?) \s*
Expand Down

0 comments on commit 8d3af59

Please sign in to comment.