There was an error while loading. Please reload this page.
1 parent 8aac3da commit 488c43eCopy full SHA for 488c43e
1 file changed
src/mistune/util.py
@@ -1,9 +1,10 @@
1
import re
2
-from html import _replace_charref # type: ignore[attr-defined]
3
-from typing import Match
+import html
+from typing import Callable, Match, cast
4
from urllib.parse import quote
5
6
_expand_tab_re = re.compile(r"^( {0,3})\t", flags=re.M)
7
+_replace_charref = cast(Callable[[Match[str]], str], getattr(html, "_replace_charref"))
8
9
10
def expand_leading_tab(text: str, width: int = 4) -> str:
0 commit comments