Specify an html tokenizer when calling linkify. #6

Merged
merged 1 commit into from Jul 18, 2012
View
@@ -13,6 +13,6 @@
url='http://www.github.com/dcramer/py-wikimarkup/',
zip_safe=False,
include_package_data=True,
- install_requires=['bleach'],
+ install_requires=['bleach>=1.1.4'],
package_data = { '': ['README.rst'] },
)
View
@@ -23,6 +23,8 @@
import bleach
+from html5lib.tokenizer import HTMLTokenizer
+
# a few patterns we use later
MW_COLON_STATE_TEXT = 0
@@ -1711,7 +1713,7 @@ def parse(self, text, show_toc=True, tags=ALLOWED_TAGS,
if utf8:
text.encode("utf-8")
# Pass output through bleach and linkify
- text = bleach.linkify(text, nofollow=nofollow)
+ text = bleach.linkify(text, nofollow=nofollow, tokenizer=HTMLTokenizer)
return bleach.clean(text, tags=self.tags, attributes=attributes,
styles=styles, strip_comments=False)