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 authored Dec 6, 2016
1 parent c9a2a0e commit b76c8b7
Showing 1 changed file with 1 addition and 2 deletions.
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 b76c8b7

Please sign in to comment.