summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Diemer <github.com@jensdiemer.de>2012-11-01 10:16:03 -0700
committerJens Diemer <github.com@jensdiemer.de>2012-11-01 10:16:03 -0700
commit8d3af59c4826ad53826c46d4884bbf4cceff9eb7 (patch)
tree340418ca12b81cca79ec76d7484dde24fa7030f6
parente4846a3ef8f25e7c8499698952a1b4af26d9bf78 (diff)
parent146f12745a362e6ca7bc658f07b5e5db91f2942c (diff)
downloadcreole-8d3af59c4826ad53826c46d4884bbf4cceff9eb7.tar.gz
Merge pull request #10 from Sepero/master
Only comment code added
-rw-r--r--creole/creole2html/parser.py2
-rw-r--r--creole/creole2html/rules.py8
2 files changed, 9 insertions, 1 deletions
diff --git a/creole/creole2html/parser.py b/creole/creole2html/parser.py
index f6b538f..ad4d7a2 100644
--- a/creole/creole2html/parser.py
+++ b/creole/creole2html/parser.py
@@ -124,7 +124,7 @@ class CreoleParser(object):
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)
diff --git a/creole/creole2html/rules.py b/creole/creole2html/rules.py
index f0f9a8e..d8fba00 100644
--- a/creole/creole2html/rules.py
+++ b/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*