2022-09-29 09:00:27 +02:00
|
|
|
--- a/bleach/html5lib_shim.py.orig
|
|
|
|
+++ b/bleach/html5lib_shim.py
|
|
|
|
@@ -14,46 +14,46 @@ warnings.filterwarnings(
|
2021-04-13 12:30:56 +02:00
|
|
|
"ignore",
|
|
|
|
message="html5lib's sanitizer is deprecated",
|
|
|
|
category=DeprecationWarning,
|
|
|
|
- module="bleach._vendor.html5lib",
|
|
|
|
+ module="html5lib",
|
|
|
|
)
|
2019-03-03 13:34:08 +01:00
|
|
|
|
2021-04-13 12:30:56 +02:00
|
|
|
-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
|
2019-03-03 13:34:08 +01:00
|
|
|
HTMLParser,
|
|
|
|
getTreeWalker,
|
|
|
|
)
|
2021-04-13 12:30:56 +02:00
|
|
|
-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
|
2019-03-03 13:34:08 +01:00
|
|
|
namespaces,
|
|
|
|
prefixes,
|
|
|
|
)
|
2021-04-13 12:30:56 +02:00
|
|
|
-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,
|
2022-09-29 09:00:27 +02:00
|
|
|
allowed_css_properties,
|
|
|
|
allowed_svg_properties,
|
2021-04-13 12:30:56 +02:00
|
|
|
) # 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
|
2019-03-03 13:34:08 +01:00
|
|
|
|
2022-09-29 09:00:27 +02:00
|
|
|
--- a/tests/test_clean.py.orig
|
|
|
|
+++ b/tests/test_clean.py
|
|
|
|
@@ -5,7 +5,7 @@ import pytest
|
2020-03-23 11:22:56 +01:00
|
|
|
from bleach import clean
|
|
|
|
from bleach.html5lib_shim import Filter
|
2022-09-29 09:00:27 +02:00
|
|
|
from bleach.sanitizer import ALLOWED_PROTOCOLS, Cleaner
|
2020-03-23 11:22:56 +01:00
|
|
|
-from bleach._vendor.html5lib.constants import rcdataElements
|
|
|
|
+from html5lib.constants import rcdataElements
|
|
|
|
|
2021-04-13 12:30:56 +02:00
|
|
|
|
2022-09-29 09:00:27 +02:00
|
|
|
@pytest.mark.parametrize(
|
|
|
|
--- a/bleach/sanitizer.py.orig
|
|
|
|
+++ b/bleach/sanitizer.py
|
|
|
|
@@ -277,7 +277,7 @@ class BleachSanitizerFilter(html5lib_shi
|
2021-04-13 12:30:56 +02:00
|
|
|
"ignore",
|
|
|
|
message="html5lib's sanitizer is deprecated",
|
|
|
|
category=DeprecationWarning,
|
|
|
|
- module="bleach._vendor.html5lib",
|
|
|
|
+ module="html5lib",
|
|
|
|
)
|
2022-09-29 09:00:27 +02:00
|
|
|
return super().__init__(
|
|
|
|
source,
|
|
|
|
--- a/bleach/parse_shim.py.orig
|
|
|
|
+++ b/bleach/parse_shim.py
|
|
|
|
@@ -1 +1 @@
|
|
|
|
-from bleach._vendor.parse import urlparse # noqa
|
|
|
|
+from urllib.parse import urlparse # noqa
|