Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for <ol reversed>, related attributes#396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ambv merged 4 commits intohtml5lib:masterfromtwm:ol-reversed
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletionCHANGES.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,10 +11,15 @@ 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!)
* Add support for serializing the ``<ol reversed>`` boolean attribute. (Thank
you, Tom Most!) (#396)
* The ``<ol reversed>`` and ``<ol start>`` attributes are now permitted by the
sanitizer. (#321) (Thank you, Tom Most!)

Bug fixes:

* The sanitizer now permits ``<summary>`` tags.
* The sanitizer now permits ``<summary>`` tags. It used to allow ``<details>``
already. (#423)

1.1
~~~
Expand Down
1 change: 1 addition & 0 deletionshtml5lib/constants.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -617,6 +617,7 @@
"button": frozenset(["disabled", "autofocus"]),
"input": frozenset(["disabled", "readonly", "required", "autofocus", "checked", "ismap"]),
"select": frozenset(["disabled", "readonly", "autofocus", "multiple"]),
"ol": frozenset(["reversed"]),
"output": frozenset(["disabled", "readonly"]),
"iframe": frozenset(["seamless"]),
}
Expand Down
2 changes: 2 additions & 0 deletionshtml5lib/filters/sanitizer.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -365,6 +365,7 @@
(None, 'maxsize'),
(None, 'minsize'),
(None, 'other'),
(None, 'reversed'),
(None, 'rowalign'),
(None, 'rowalign'),
(None, 'rowalign'),
Expand All@@ -375,6 +376,7 @@
(None, 'scriptlevel'),
(None, 'selection'),
(None, 'separator'),
(None, 'start'),
(None, 'stretchy'),
(None, 'width'),
(None, 'width'),
Expand Down
18 changes: 18 additions & 0 deletionshtml5lib/tests/test_sanitizer.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -154,3 +154,21 @@ def test_uppercase_color_codes_in_style():
sanitized = sanitize_html("<p style=\"border: 1px solid #A2A2A2;\"></p>")
expected = '<p style=\"border: 1px solid #A2A2A2;\"></p>'
assert expected == sanitized


def test_ol_start_allowed():
sanitized = sanitize_html("<ol start=2><li>.</ol>")
expected = '<ol start="2"><li>.</li></ol>'
assert expected == sanitized


def test_ol_type_allowed():
sanitized = sanitize_html("<ol type=I><li>.</ol>")
expected = '<ol type="I"><li>.</li></ol>'
assert expected == sanitized


def test_ol_reversed_allowed():
sanitized = sanitize_html("<ol reversed><li>.</ol>")
expected = '<ol reversed><li>.</li></ol>'
assert expected == sanitized

[8]ページ先頭

©2009-2025 Movatter.jp