[docutils] Extend applicable types to _ContentModelCategory (#14719)

This commit is contained in:
Semyon Moroz
2025-09-18 15:57:51 +02:00
committed by GitHub
parent add4e85823
commit 4b0fec4506
3 changed files with 3 additions and 8 deletions
+2 -1
View File
@@ -12,7 +12,8 @@ from docutils.transforms import Transform, Transformer
from docutils.utils import Reporter
_N = TypeVar("_N", bound=Node)
_ContentModelCategory: TypeAlias = type[Element] | tuple[type[Element], ...]
_ElementLikeType: TypeAlias = type[Element | Text | Body | Bibliographic | Inline]
_ContentModelCategory: TypeAlias = _ElementLikeType | tuple[_ElementLikeType, ...]
_ContentModelQuantifier: TypeAlias = Literal[".", "?", "+", "*"]
_ContentModelItem: TypeAlias = tuple[_ContentModelCategory, _ContentModelQuantifier]
_ContentModelTuple: TypeAlias = tuple[_ContentModelItem, ...]
@@ -43,7 +43,7 @@ class StripClassesAndElements(Transform):
class SmartQuotes(Transform):
default_priority: ClassVar[int]
nodes_to_skip: ClassVar[tuple[type[nodes.Node], ...]]
nodes_to_skip: ClassVar[tuple[type[nodes.Node | nodes.Special], ...]]
literal_nodes: ClassVar[tuple[type[nodes.Node | nodes.Body], ...]]
smartquotes_action: ClassVar[str]
unsupported_languages: set[str]