Skip to content

Commit f6751d9

Browse files
committed
bleach use new generic filter
1 parent 79c91e0 commit f6751d9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

stubs/bleach/bleach/linkifier.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Linker:
3636
# or `html5lib` token might be reused
3737
_Token: TypeAlias = dict[str, Any]
3838

39-
class LinkifyFilter(Filter):
39+
class LinkifyFilter(Filter[_Token]):
4040
callbacks: Iterable[_Callback]
4141
skip_tags: Container[str]
4242
parse_email: bool

stubs/bleach/bleach/sanitizer.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from _typeshed import Incomplete
12
from collections.abc import Callable, Container, Iterable, Iterator
23
from re import Pattern
34
from typing import Final, Protocol, type_check_only
@@ -24,7 +25,7 @@ class NoCssSanitizerWarning(UserWarning): ...
2425

2526
@type_check_only
2627
class _FilterConstructor(Protocol):
27-
def __call__(self, *, source: BleachSanitizerFilter) -> Filter: ...
28+
def __call__(self, *, source: BleachSanitizerFilter) -> Filter[Incomplete]: ...
2829

2930
# _FilterConstructor used to be called _Filter
3031
# this alias is obsolete and can potentially be removed in the future
@@ -40,7 +41,7 @@ class Cleaner:
4041
protocols: Iterable[str]
4142
strip: bool
4243
strip_comments: bool
43-
filters: Iterable[Filter]
44+
filters: Iterable[_FilterConstructor]
4445
css_sanitizer: CSSSanitizer | None
4546
parser: BleachHTMLParser
4647
walker: TreeWalker

0 commit comments

Comments
 (0)