FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Support the <wbr> element by twm · Pull Request #395 · html5lib/html5lib-python · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (3) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 10 additions & 0 deletions CHANGES.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,23 @@ Change Log
1.2
~~~

Unreleased yet

Features:

* Add support for the ``<wbr>`` element in the sanitizer, `which indicates
a line break opportunity <https://html.spec.whatwg.org/#the-wbr-element>`_.
This element is allowed by default. (#395) (Thank you, Tom Most!)

Bug fixes:

* The sanitizer now permits ``<summary>`` tags.

1.1
~~~

Released on June 23, 2020

Breaking changes:

* Drop support for Python 3.3. (#358)
Expand Down
3 changes: 2 additions & 1 deletion html5lib/constants.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@
"col",
"input",
"source",
"track"
"track",
"wbr",
])

cdataElements = frozenset(['title', 'textarea'])
Expand Down
1 change: 1 addition & 0 deletions html5lib/filters/sanitizer.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
(namespaces['html'], 'ul'),
(namespaces['html'], 'var'),
(namespaces['html'], 'video'),
(namespaces['html'], 'wbr'),
(namespaces['mathml'], 'maction'),
(namespaces['mathml'], 'math'),
(namespaces['mathml'], 'merror'),
Expand Down
6 changes: 6 additions & 0 deletions html5lib/tests/test_sanitizer.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ def test_data_uri_disallowed_type():
assert expected == sanitized


def test_wbr_allowed():
sanitized = sanitize_html('<wbr>')
expected = '<wbr/>'
assert expected == sanitized


def param_sanitizer():
for ns, tag_name in sanitizer.allowed_elements:
if ns != constants.namespaces["html"]:
Expand Down

Back | FazBrowse Home | New Git URL