Skip to content

Commit

Permalink
Make WeasyPrint work w/ html5lib 0.9999999 (7 9s)
Browse files Browse the repository at this point in the history
We need this older version of html5lib because bleach doesn’t yet support versions greater than 0.9999999 (7 9s). It will at some point in the future: mozilla/bleach#229

Weasyprint doesn’t support versions of html5lib lower than 0.999999999 (9 9s) and isn’t going to: Kozea#353 (comment)

So this commit patches Weasyprint to use the older version.
  • Loading branch information
quis committed Dec 6, 2016
1 parent c9a2a0e commit 99718c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
REQUIREMENTS = [
# XXX: Keep this in sync with docs/install.rst
'lxml>=3.0',
'html5lib>=0.999999999',
'html5lib==0.9999999',
'tinycss>=0.4',
'cssselect>=0.6',
'cffi>=0.6',
Expand Down
3 changes: 1 addition & 2 deletions weasyprint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ def __init__(self, guess=None, filename=None, url=None, file_obj=None,
namespaceHTMLElements=False)
else:
result = html5lib.parse(
source, treebuilder='lxml', override_encoding=encoding,
transport_encoding=protocol_encoding,
str(source), treebuilder='lxml',
namespaceHTMLElements=False)
assert result
base_url = find_base_url(result, base_url)
Expand Down

0 comments on commit 99718c2

Please sign in to comment.