11import re
2+ from _typeshed import Unused
3+ from collections import deque
24from collections .abc import Collection
3- from typing import ClassVar , NamedTuple
5+ from typing import ClassVar , Final , NamedTuple
46from xml .etree .ElementTree import Element
57
68from markdown import util
79from markdown .core import Markdown
810
9- def build_inlinepatterns (md : Markdown , ** kwargs ) -> util .Registry [Pattern ]: ...
10-
11- NOIMG : str
12- BACKTICK_RE : str
13- ESCAPE_RE : str
14- EMPHASIS_RE : str
15- STRONG_RE : str
16- SMART_STRONG_RE : str
17- SMART_EMPHASIS_RE : str
18- SMART_STRONG_EM_RE : str
19- EM_STRONG_RE : str
20- EM_STRONG2_RE : str
21- STRONG_EM_RE : str
22- STRONG_EM2_RE : str
23- STRONG_EM3_RE : str
24- LINK_RE : str
25- IMAGE_LINK_RE : str
26- REFERENCE_RE : str
27- IMAGE_REFERENCE_RE : str
28- NOT_STRONG_RE : str
29- AUTOLINK_RE : str
30- AUTOMAIL_RE : str
31- HTML_RE : str
32- ENTITY_RE : str
33- LINE_BREAK_RE : str
11+ def build_inlinepatterns (md : Markdown , ** kwargs : Unused ) -> util .Registry [Pattern ]: ...
12+
13+ NOIMG : Final [str ]
14+ BACKTICK_RE : Final [str ]
15+ ESCAPE_RE : Final [str ]
16+ LINK_RE : Final [str ]
17+ IMAGE_LINK_RE : Final [str ]
18+ REFERENCE_RE : Final [str ]
19+ IMAGE_REFERENCE_RE : Final [str ]
20+ AUTOLINK_RE : Final [str ]
21+ AUTOMAIL_RE : Final [str ]
22+ HTML_RE : Final [str ]
23+ ENTITY_RE : Final [str ]
24+ LINE_BREAK_RE : Final [str ]
3425
3526def dequote (string : str ) -> str : ...
3627
@@ -74,6 +65,8 @@ class BacktickInlineProcessor(InlineProcessor):
7465 ESCAPED_BSLASH : str
7566 tag : str
7667 def __init__ (self , pattern : str ) -> None : ...
68+ def find_code_spans (self , start : int , text : str ) -> tuple [int , int ] | None : ...
69+ def handleMatch (self , m : re .Match [str ], data : str ) -> tuple [Element | str | None , int | None , int | None ]: ... # type: ignore[override]
7770
7871class DoubleTagPattern (SimpleTagPattern ): ...
7972class DoubleTagInlineProcessor (SimpleTagInlineProcessor ): ...
@@ -82,15 +75,48 @@ class HtmlInlineProcessor(InlineProcessor):
8275 def unescape (self , text : str ) -> str : ...
8376 def backslash_unescape (self , text : str ) -> str : ...
8477
85- class AsteriskProcessor (InlineProcessor ):
86- PATTERNS : ClassVar [list [EmStrongItem ]]
87- def build_single (self , m : re .Match [str ], tag : str , idx : int ) -> Element : ...
88- def build_double (self , m : re .Match [str ], tags : str , idx : int ) -> Element : ...
89- def build_double2 (self , m : re .Match [str ], tags : str , idx : int ) -> Element : ...
90- def parse_sub_patterns (self , data : str , parent : Element , last : Element | None , idx : int ) -> None : ...
91- def build_element (self , m : re .Match [str ], builder : str , tags : str , index : int ) -> Element : ...
78+ class Delimiter :
79+ stack : deque [tuple [int , int , bool , int ]]
80+ tag_count : int
81+ tags : tuple [str , str ]
82+ double : bool
83+ single : bool
84+ smart : bool
85+
86+ token : str
87+ max_size : int
88+ boundary : re .Pattern [str ]
89+ bad : re .Pattern [str ]
90+
91+ def __init__ (self , token : str , tags : str , smart : bool , double : bool ): ...
92+ def reset (self ) -> None : ...
93+
94+ class DelimiterProcessor (InlineProcessor ):
95+ SPACE : Final [re .Pattern [str ]]
96+
97+ regions : list [tuple [int , int , int , int , tuple [str , str ], int ]]
98+ stack : list [tuple [int , int , bool , int ]]
99+ tokens : list [str ]
100+ delimiters : dict [str , Delimiter ]
101+ cache_index : int
102+ cache_pos : int
103+ md : Markdown
104+ safe_mode : bool
105+ pattern : str
106+ compiled_re : re .Pattern [str ]
92107
93- class UnderscoreProcessor (AsteriskProcessor ): ...
108+ def __init__ (self , token : str , tags : str , md : Markdown , smart : bool = False , double : bool = False ) -> None : ...
109+ def add (self , token : str , tags : str , smart : bool = False , double : bool = False ) -> None : ...
110+ def remove (self , token : str ) -> None : ...
111+ def reset (self ) -> None : ...
112+ def increment_next_position (self , start : int , count : int ) -> None : ...
113+ def get_cached_result (self , pos : int , data : str ) -> tuple [Element , int , int ]: ...
114+ def get_match (self , data : str , start : int ) -> re .Match [str ] | None : ...
115+ def search (self , data : str , start : int ) -> re .Match [str ] | None : ...
116+ def add_region (self , delim : Delimiter , a : int , b : int , c : int , d : int , size : int ) -> None : ...
117+ def handleMatch ( # type: ignore[override]
118+ self , m : re .Match [str ], data : str
119+ ) -> tuple [Element | None , int | None , int | None ]: ...
94120
95121class LinkInlineProcessor (InlineProcessor ):
96122 RE_LINK : ClassVar [re .Pattern [str ]]
0 commit comments