diff options
author | JensDiemer <git@jensdiemer.de> | 2012-09-03 17:11:27 +0200 |
---|---|---|
committer | JensDiemer <git@jensdiemer.de> | 2012-09-03 17:11:27 +0200 |
commit | a6ce4821ee25c9c46cc505b91d04ed8e1773d4d4 (patch) | |
tree | bdf4be636633d26c2bdc187ea22959934b61c1b9 | |
parent | dbeb4d79426076ecfe23fc08ad520ecc17a2e5e6 (diff) | |
download | creole-a6ce4821ee25c9c46cc505b91d04ed8e1773d4d4.tar.gz |
made automatic protocol links more strict: Only whitespace before and at the end are allowed.
-rw-r--r-- | AUTHORS | 3 | ||||
-rw-r--r-- | README.creole | 2 | ||||
-rw-r--r-- | creole/__init__.py | 2 | ||||
-rw-r--r-- | creole/creole2html/rules.py | 7 | ||||
-rw-r--r-- | creole/tests/test_creole2html.py | 9 |
5 files changed, 10 insertions, 13 deletions
@@ -15,7 +15,8 @@ PRIMARY AUTHORS are and/or have been (alphabetic order): Homepage: <http://www.jensdiemer.de/> -CONTRIBUTORS are and/or have been (alphabetic order): +CONTRIBUTORS are and/or have been: +* Sepero <https://github.com/Sepero> * Vitja.Makarov <http://code.google.com/u/Vitja.Makarov/> * Betz Stefan alias 'encbladexp' <http://www.stefan-betz.net/> * Eric O'Connell <eric@zerominuszero.net> diff --git a/README.creole b/README.creole index 4092996..1bfc63f 100644 --- a/README.creole +++ b/README.creole @@ -163,6 +163,8 @@ Note: In this case you must install **docutils**! See above. = history = +* v1.0.5.pre +** made automatic protocol links more strict: Only whitespace before and at the end are allowed. * v1.0.4 ** html2rest: Handle double link/image substitution and raise better error messages ** Bugfix in unittests (include test README file in python package). Thanks to Wen Heping for reporting this. diff --git a/creole/__init__.py b/creole/__init__.py index ecad561..dcffdbf 100644 --- a/creole/__init__.py +++ b/creole/__init__.py @@ -20,7 +20,7 @@ from __future__ import division, absolute_import, print_function, unicode_literals -__version__ = (1, 0, 4) +__version__ = (1, 0, 5, "pre") __api__ = (1, 0) # Creole 1.0 spec - http://wikicreole.org/ diff --git a/creole/creole2html/rules.py b/creole/creole2html/rules.py index 1a9c152..701c959 100644 --- a/creole/creole2html/rules.py +++ b/creole/creole2html/rules.py @@ -5,7 +5,7 @@ Creole Rules for parser ~~~~~~~~~~~~~~~~~~~~~~~ - :copyleft: 2008-2011 by python-creole team, see AUTHORS for more details. + :copyleft: 2008-2012 by python-creole team, see AUTHORS for more details. :license: GNU GPL v3 or above, see LICENSE for more details. """ @@ -20,10 +20,9 @@ class InlineRules(object): """ proto = r'http|https|ftp|nntp|news|mailto|telnet|file|irc' url = r'''(?P<url> - (^ | (?<=\s | [.,:;!?()/=])) + (^ | (?<=\s)) (?P<escaped_url>~)? - (?P<url_target> (?P<url_proto> %s ):\S+? ) - ($ | (?=\s | [,.:;!?()] (\s | $))) + (?P<url_target> (?P<url_proto> %s )://[^$\s]+ ) )''' % proto link = r'''(?P<link> \[\[ diff --git a/creole/tests/test_creole2html.py b/creole/tests/test_creole2html.py index 6e60fc1..897397b 100644 --- a/creole/tests/test_creole2html.py +++ b/creole/tests/test_creole2html.py @@ -12,7 +12,7 @@ Test the creole markup. - :copyleft: 2008-2011 by python-creole team, see AUTHORS for more details. + :copyleft: 2008-2012 by python-creole team, see AUTHORS for more details. :license: GNU GPL v3 or above, see LICENSE for more details. """ @@ -555,7 +555,7 @@ class TestCreole2htmlMarkup(BaseCreoleTest): self.assert_creole2html(r""" A http://en.wikipedia.org/wiki/Uri_(Island) link. """, """ - <p>A <a href="http://en.wikipedia.org/wiki/Uri_(Island)">http://en.wikipedia.org/wiki/Uri_(Island)</a>) link.</p> + <p>A <a href="http://en.wikipedia.org/wiki/Uri_(Island)">http://en.wikipedia.org/wiki/Uri_(Island)</a> link.</p> """) def test_wrong_protocol(self): @@ -579,11 +579,6 @@ class TestCreole2htmlMarkup(BaseCreoleTest): """, """ <p>missing space.ftp://ok</p> """) - self.assert_creole2html(r""" - ftp://ok(Also missed space) - """, """ - <p>ftp://ok(Also missed space)</p> - """) class TestStr2Dict(unittest.TestCase): |