* bleach.clean, bleach.sanitizer.Cleaner, bleach.html5lib_shim.BleachHTMLParser: the tags and protocols arguments were changed from lists to sets. * bleach.linkify, bleach.linkifier.Linker: the skip_tags and recognized_tags arguments were changed from lists to sets. * bleach.sanitizer.BleachSanitizerFilter: strip_allowed_elements is now strip_allowed_tags. We now use “tags” everywhere rather than a mishmash of “tags” in some places and “elements” in others. # Bug fixes * Add support for Python 3.11. (#675) * Fix API weirness in BleachSanitizerFilter. (#649) * We’re using “tags” instead of “elements” everywhere–no more weird overloading of “elements” anymore. * Also, it no longer calls the superclass constructor. * Add warning when css_sanitizer isn’t set, but the style attribute is allowed. (#676) * Fix linkify handling of character entities. (#501) * Rework dev dependencies to use requirements-dev.txt and requirements-flake8.txt instead of extras. * Fix project infrastructure to be tox-based so it’s easier to have CI run the same things we’re running in development and with flake8 in an isolated environment. * Update action versions in CI. * Switch to f-strings where possible. Make tests parametrized to be easier to read/maintain. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bleach?expand=0&rev=51
87 lines
3.3 KiB
Diff
87 lines
3.3 KiB
Diff
Index: bleach-6.0.0/bleach/html5lib_shim.py
|
|
===================================================================
|
|
--- bleach-6.0.0.orig/bleach/html5lib_shim.py
|
|
+++ bleach-6.0.0/bleach/html5lib_shim.py
|
|
@@ -14,27 +14,27 @@ warnings.filterwarnings(
|
|
"ignore",
|
|
message="html5lib's sanitizer is deprecated",
|
|
category=DeprecationWarning,
|
|
- module="bleach._vendor.html5lib",
|
|
+ module="html5lib",
|
|
)
|
|
|
|
-from bleach._vendor.html5lib import ( # noqa: E402 module level import not at top of file
|
|
+from html5lib import ( # noqa: E402 module level import not at top of file
|
|
HTMLParser,
|
|
getTreeWalker,
|
|
)
|
|
-from bleach._vendor.html5lib import (
|
|
+from html5lib import (
|
|
constants,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib.constants import ( # noqa: E402 module level import not at top of file
|
|
+from html5lib.constants import ( # noqa: E402 module level import not at top of file
|
|
namespaces,
|
|
prefixes,
|
|
)
|
|
-from bleach._vendor.html5lib.constants import (
|
|
+from html5lib.constants import (
|
|
_ReparseException as ReparseException,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib.filters.base import (
|
|
+from html5lib.filters.base import (
|
|
Filter,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib.filters.sanitizer import (
|
|
+from html5lib.filters.sanitizer import (
|
|
allowed_protocols,
|
|
allowed_css_properties,
|
|
allowed_svg_properties,
|
|
@@ -42,21 +42,21 @@ from bleach._vendor.html5lib.filters.san
|
|
svg_attr_val_allows_ref,
|
|
svg_allow_local_href,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib.filters.sanitizer import (
|
|
+from html5lib.filters.sanitizer import (
|
|
Filter as SanitizerFilter,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib._inputstream import (
|
|
+from html5lib._inputstream import (
|
|
HTMLInputStream,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib.serializer import (
|
|
+from html5lib.serializer import (
|
|
escape,
|
|
HTMLSerializer,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib._tokenizer import (
|
|
+from html5lib._tokenizer import (
|
|
attributeMap,
|
|
HTMLTokenizer,
|
|
) # noqa: E402 module level import not at top of file
|
|
-from bleach._vendor.html5lib._trie import (
|
|
+from html5lib._trie import (
|
|
Trie,
|
|
) # noqa: E402 module level import not at top of file
|
|
|
|
Index: bleach-6.0.0/tests/test_clean.py
|
|
===================================================================
|
|
--- bleach-6.0.0.orig/tests/test_clean.py
|
|
+++ bleach-6.0.0/tests/test_clean.py
|
|
@@ -5,7 +5,7 @@ import pytest
|
|
from bleach import clean
|
|
from bleach.html5lib_shim import Filter
|
|
from bleach.sanitizer import ALLOWED_PROTOCOLS, Cleaner, NoCssSanitizerWarning
|
|
-from bleach._vendor.html5lib.constants import rcdataElements
|
|
+from html5lib.constants import rcdataElements
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
Index: bleach-6.0.0/bleach/parse_shim.py
|
|
===================================================================
|
|
--- bleach-6.0.0.orig/bleach/parse_shim.py
|
|
+++ bleach-6.0.0/bleach/parse_shim.py
|
|
@@ -1 +1 @@
|
|
-from bleach._vendor.parse import urlparse # noqa
|
|
+from urllib.parse import urlparse # noqa
|