Skip to content

Commit 28d8ff1

Browse files
authored
[docutils] Add parsers.commonmark_wrapper (#14243)
1 parent 0ca7321 commit 28d8ff1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

stubs/docutils/@tests/stubtest_allowlist.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ docutils.nodes.NodeVisitor.depart_\w+ # Methods are discovered dynamically on c
99
docutils.nodes.NodeVisitor.visit_\w+ # Methods are discovered dynamically on commonly-used subclasses
1010
# these methods take a rawsource parameter that has been deprecated and is completely ignored, so we omit it from the stub
1111
docutils.nodes.Text.__new__
12-
docutils.parsers.recommonmark_wrapper
12+
docutils.parsers.commonmark_wrapper # doesn't exist at runtime of stubtests
13+
docutils.parsers.recommonmark_wrapper # doesn't exist at runtime of stubtests
1314
docutils.parsers.rst.directives.admonitions.BaseAdmonition.node_class # must be overridden by base classes (pseudo-abstract)
1415
docutils.statemachine.State.nested_sm # is initialised in __init__
1516
docutils.statemachine.State.nested_sm_kwargs # is initialised in __init__
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from typing import Literal
2+
from typing_extensions import TypeAlias
3+
4+
from docutils import parsers
5+
6+
_ParserName: TypeAlias = Literal["pycmark", "myst", "recommonmark"]
7+
8+
commonmark_parser_names: tuple[_ParserName, ...]
9+
Parser: type[parsers.Parser] # if Parser is None or parser_name is empty string, user cannot import current module
10+
parser_name: _ParserName

0 commit comments

Comments
 (0)