Files
ServerSync/lib/markdown_it/__pycache__/ruler.cpython-314.pyc

115 lines
14 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
<00> <0C>i<EFBFBD>#<00><01><00>Rt^RIHt^RIHt^RIHtHt^RIH t H
t
H t H t ^RI t ^RIHt] 'd^RIHt!RR 4t!R
R ] R R 7t] !R4t]!RR7!RR]
],44t!RR]
],4tR#)a<>
class Ruler
Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and
[[MarkdownIt#inline]] to manage sequences of functions (rules):
- keep rules in defined order
- assign the name to each rule
- enable/disable rules
- add/replace rules
- allow assign rules to additional named chains (in the same)
- caching lists of active rules
You will not need use this class directly until write plugins. For simple
rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and
[[MarkdownIt.use]].
)<01> annotations)<01>Iterable)<02> dataclass<73>field)<04> TYPE_CHECKING<4E>Generic<69> TypedDict<63>TypeVarN)<01>EnvType)<01>
MarkdownItc<01>x<00>]tRt^ tRRlt]RRl4t]PRRl4t]RRl4tR t R
#) <0B> StateBasec<01>$<00>V^8<>dQhRRRRRR/#)<07><00>src<72>str<74>mdr <00>envr
<00>)<01>formats"<22>8/tmp/pip-target-qd_sq_1j/lib/python/markdown_it/ruler.py<70> __annotate__<5F>StateBase.__annotate__!s!<00><00><15><15>C<EFBFBD><15>Z<EFBFBD><15>g<EFBFBD><15>c <09>*<00>WnW0nW nR#<00>N)rrr)<04>selfrrrs&&&&r<00>__init__<5F>StateBase.__init__!s<00><00><16><08><16><08><14>rc<01><00>V^8<>dQhRR/#)r<00>returnrr)rs"rrr's<00><00><19><19>S<EFBFBD>rc <09><00>VP#r)<01>_src<72>rs&rr<00> StateBase.src&s <00><00><13>y<EFBFBD>y<EFBFBD>rc<01> <00>V^8<>dQhRRRR/#)r<00>valuerr <00>Noner)rs"rrr+s<00><00>9<>9<><13>9<><14>9rc <09> <00>WnRVnR#r)r"<00> _srcCharCode)rr&s&&rrr$*s<00><00><19> <09>48<34><04>rc<01><00>V^8<>dQhRR/#)rr ztuple[int, ...]r)rs"rrr0s<00><00>!<21>!<21>_<EFBFBD>!rc <09><><00>\P!R\^R7VPfF\;QJd.RVP
4FNK 5M!RVP
44VnVP#)z?StateBase.srcCharCode is deprecated. Use StateBase.src instead.)<01>
stacklevelc3<01>8"<00>TFp\V4x<00>K R#5ir)<01>ord)<02>.0<EFBFBD>cs& r<00> <genexpr><3E>(StateBase.srcCharCode.<locals>.<genexpr>7s<00><00><00>%@<40>i<EFBFBD><11>c<EFBFBD>!<21>f<EFBFBD>f<EFBFBD>i<EFBFBD>s<00>)<06>warnings<67>warn<72>DeprecationWarningr)<00>tupler"r#s&r<00> srcCharCode<64>StateBase.srcCharCode/sZ<00><00><10> <0A> <0A> M<> <1E><18>
<EFBFBD>
<10> <1C> <1C> $<24> %<25><05>%@<40>d<EFBFBD>i<EFBFBD>i<EFBFBD>%@<40><05><05>%@<40>d<EFBFBD>i<EFBFBD>i<EFBFBD>%@<40> @<40>D<EFBFBD> <1D><13> <20> <20> r)r"r)rrrN)
<EFBFBD>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__r<00>propertyr<00>setterr7<00>__static_attributes__rrrr r sG<00><00><15>
<0E><19><0E><19> <09>Z<EFBFBD>Z<EFBFBD>9<><10>9<><0E>!<21><0E>!rr c<01>"<00>]tRt^;t$R]R&RtR#)<05>RuleOptionsType<70> list[str]<5D>altrN)r9r:r;r<<00>__annotations__r?rrrrArA;s<00><00> <12>NrrAF)<01>total<61>
RuleFuncTvT)<01>slotsc<01>R<00>]tRt^Ct$R]R&R]R&]!RR7tR]R&R ]R
&R tR #) <0A>Ruler<00>name<6D>bool<6F>enabledF)<01>reprrF<00>fnrBrCrN)r9r:r;r<rDrrNr?rrrrIrICs <00><00>
<0A>I<EFBFBD> <11>M<EFBFBD><1A><05>&<26>B<EFBFBD>
<EFBFBD>&<26> <12>NrrIc<01><><00>]tRt^KtRRltRRltRRltRRR lltRR
R lltRR R llt RRRllt
RRRllt RRRllt RRRllt RRRlltRRltRRltRtR#) <20>Rulerc<01><00>V^8<>dQhRR/#<00>rr r'r)rs"rr<00>Ruler.__annotate__Ls<00><00>B<01>B<01>$<24>Brc <09>"<00>.VnRVnR#r)<02> __rules__<5F> __cache__r#s&rr<00>Ruler.__init__Ls<00><00>13<31><04><0E>>B<01><04>rc<01> <00>V^8<>dQhRRRR/#)rrJrr <00>intr)rs"rrrSTs<00><00><12><12>S<EFBFBD><12>S<EFBFBD>rc <0A>l<00>\VP4Fwr#VPV8XgKVu# R#)zFind rule index by name<6D><65><EFBFBD><EFBFBD><EFBFBD>)<03> enumeraterUrJ)rrJ<00>i<>rules&& r<00>__find__<5F>Ruler.__find__Ts/<00><00> <20><14><1E><1E>0<>G<EFBFBD>A<EFBFBD><13>y<EFBFBD>y<EFBFBD>D<EFBFBD> <20><18><08>1<><12> rc<01><00>V^8<>dQhRR/#rRr)rs"rrrS[s<00><00>6<>6<>T<EFBFBD>6rc <0A><><00>R0pVPF;pVP'gKVPFpVPV4K K= /VnVFp.VPV&VPF]pVP'gKV'dWBP9dK1VPV,P VP 4K_ K<> R#)zBuild rules lookup cache<68>N)rUrLrC<00>addrV<00>appendrN)r<00>chainsr^rJ<00>chains& r<00> __compile__<5F>Ruler.__compile__[s<><00><00><14><14><06><18>N<EFBFBD>N<EFBFBD>D<EFBFBD><17><<3C><<3C><<3C><18><1C><08><08><04><16>
<EFBFBD>
<EFBFBD>4<EFBFBD> <20>!<21>#<23>
<1C><04><0E><1B>E<EFBFBD>$&<26>D<EFBFBD>N<EFBFBD>N<EFBFBD>5<EFBFBD> !<21><1C><0E><0E><04><1B>|<7C>|<7C>|<7C><1C><18>e<EFBFBD>8<EFBFBD>8<EFBFBD>3<><1C><14><0E><0E>u<EFBFBD>%<25>,<2C>,<2C>T<EFBFBD>W<EFBFBD>W<EFBFBD>5<> '<27>rNc<01>(<00>V^8<>dQhRRRRRRRR/#<00> r<00>ruleNamerrNrF<00>options<6E>RuleOptionsType | Noner r'r)rs"rrrSns,<00><00><1E><1E><1B><1E>!+<2B><1E>6L<36><1E> <0A>rc <0A><><00>VPV4pT;'g/pVR8Xd\RV 24hW PV,nVP R.4VPV,nRVnR#)z<>Replace rule by name with new function & options.
:param ruleName: rule name to replace.
:param fn: new rule function.
:param options: new rule options (not mandatory).
:raises: KeyError if name not found
<EFBFBD>Parser rule not found: rCNr[)r_<00>KeyErrorrUrN<00>getrCrV)rrlrNrm<00>indexs&&&& r<00>at<61>Ruler.atnsi<00><00><15> <0A> <0A>h<EFBFBD>'<27><05><19>-<2D>-<2D>R<EFBFBD><07> <10>B<EFBFBD>;<3B><1A>4<>X<EFBFBD>J<EFBFBD>?<3F>@<40> @<40>#%<25><0E><0E>u<EFBFBD><1D> <20>$+<2B>K<EFBFBD>K<EFBFBD><05>r<EFBFBD>$:<3A><04><0E><0E>u<EFBFBD><1D>!<21><1D><04>rc
<01>,<00>V^8<>dQhRRRRRRRRRR /#)
r<00>
beforeNamerrlrNrFrmrnr r'r)rs"rrrS<00>s<<00><00><1E><1E><17><1E><16><1E> <17> <1E>
(<28> <1E>
<0E> rc  <0A><><00>VPV4pT;'g/pVR8Xd\RV 24hVPPV\\
,!VRW4P R.444RVnR#)aAdd new rule to chain before one with given name.
:param beforeName: new rule will be added before this one.
:param ruleName: new rule will be added before this one.
:param fn: new rule function.
:param options: new rule options (not mandatory).
:raises: KeyError if name not found
rpTrCNr[<00>r_rqrU<00>insertrIrFrrrV)rrwrlrNrmrss&&&&& r<00>before<72> Ruler.before<72>sp<00><00><15> <0A> <0A>j<EFBFBD>)<29><05><19>-<2D>-<2D>R<EFBFBD><07> <10>B<EFBFBD>;<3B><1A>4<>Z<EFBFBD>L<EFBFBD>A<>B<> B<> <0C><0E><0E><1D><1D> <11>4<EFBFBD>
<EFBFBD>#<23>H<EFBFBD>d<EFBFBD>B<EFBFBD> <0B> <0B>E<EFBFBD>2<EFBFBD>8N<38>O<>
<EFBFBD><1E><04>rc
<01>,<00>V^8<>dQhRRRRRRRRRR /#)
r<00> afterNamerrlrNrFrmrnr r'r)rs"rrrS<00>s<<00><00><1E><1E><16><1E><16><1E> <17> <1E>
(<28> <1E>
<0E> rc  <0A> <00>VPV4pT;'g/pVR8Xd\RV 24hVPPV^,\\
,!VRW4P R.444RVnR#)aAdd new rule to chain after one with given name.
:param afterName: new rule will be added after this one.
:param ruleName: new rule will be added after this one.
:param fn: new rule function.
:param options: new rule options (not mandatory).
:raises: KeyError if name not found
rpTrCNr[ry)rr~rlrNrmrss&&&&& r<00>after<65> Ruler.after<65>st<00><00><15> <0A> <0A>i<EFBFBD>(<28><05><19>-<2D>-<2D>R<EFBFBD><07> <10>B<EFBFBD>;<3B><1A>4<>Y<EFBFBD>K<EFBFBD>@<40>A<> A<> <0C><0E><0E><1D><1D> <11>A<EFBFBD>I<EFBFBD>t<EFBFBD>J<EFBFBD>'<27><08>$<24><02>K<EFBFBD>K<EFBFBD><05>r<EFBFBD><R<>S<>
<EFBFBD><1E><04>rc<01>(<00>V^8<>dQhRRRRRRRR/#rkr)rs"rrrS<00>s,<00><00> <1E> <1E><1B> <1E>!+<2B> <1E>6L<36> <1E> <0A> rc  <0A><><00>VPP\\,!TRY#;'g/P R.444RVnR#)z<>Push new rule to the end of chain.
:param ruleName: new rule will be added to the end of chain.
:param fn: new rule function.
:param options: new rule options (not mandatory).
TrCN)rUrerIrFrrrV)rrlrNrms&&&&r<00>push<73>
Ruler.push<73>sC<00><00> <0A><0E><0E><1D><1D> <10><1A> <1C>X<EFBFBD>t<EFBFBD>R<EFBFBD>-<2D>-<2D>R<EFBFBD>1D<31>1D<31>U<EFBFBD>B<EFBFBD>1O<31> P<>
<EFBFBD><1E><04>rc<01>$<00>V^8<>dQhRRRRRR/#<00>r<00>nameszstr | Iterable[str]<5D> ignoreInvalidrKr rBr)rs"rrrS<00><00>$<00><00><16><16>(<28><16>9=<3D><16> <12>rc <0A>,<00>\V\4'dV.p.pVFkpVPV4pV^8d V'dK%V^8dV'g\RV 24hRVPV,nVP V4Km RVnV#)z<>Enable rules with given names.
:param names: name or list of rule names to enable.
:param ignoreInvalid: ignore errors when rule not found
:raises: KeyError if name not found and not ignoreInvalid
:return: list of found rule names
<EFBFBD>!Rules manager: invalid rule name TN<54><08>
isinstancerr_rqrUrLrerV<00>rr<>r<><00>resultrJ<00>idxs&&& r<00>enable<6C> Ruler.enable<6C>s<><00><00> <16>e<EFBFBD>S<EFBFBD> !<21> !<21><1A>G<EFBFBD>E<EFBFBD><1E><06><19>D<EFBFBD><16>-<2D>-<2D><04>%<25>C<EFBFBD><13>a<EFBFBD><07>]<5D><18><13>a<EFBFBD><07><1D><1E>!B<>4<EFBFBD>&<26>I<>J<>J<>*.<2E>D<EFBFBD>N<EFBFBD>N<EFBFBD>3<EFBFBD> <1F> '<27> <12>M<EFBFBD>M<EFBFBD>$<24> <1F><1A><1E><04><0E><15> rc<01>$<00>V^8<>dQhRRRRRR/#r<>r)rs"rrrS<00>s$<00><00>1<>1<>(<28>1<>9=<3D>1<> <12>1rc <0A><><00>\V\4'dV.pVPF
pRVnK VP W4#)aEnable rules with given names, and disable everything else.
:param names: name or list of rule names to enable.
:param ignoreInvalid: ignore errors when rule not found
:raises: KeyError if name not found and not ignoreInvalid
:return: list of found rule names
F)r<>rrUrLr<>)rr<>r<>r^s&&& r<00>
enableOnly<EFBFBD>Ruler.enableOnly<6C>s<<00><00> <16>e<EFBFBD>S<EFBFBD> !<21> !<21><1A>G<EFBFBD>E<EFBFBD><18>N<EFBFBD>N<EFBFBD>D<EFBFBD> <20>D<EFBFBD>L<EFBFBD>#<23><13>{<7B>{<7B>5<EFBFBD>0<>0rc<01>$<00>V^8<>dQhRRRRRR/#r<>r)rs"rrrS<00>r<>rc <0A>,<00>\V\4'dV.p.pVFkpVPV4pV^8d V'dK%V^8dV'g\RV 24hRVPV,nVP V4Km RVnV#)z<>Disable rules with given names.
:param names: name or list of rule names to enable.
:param ignoreInvalid: ignore errors when rule not found
:raises: KeyError if name not found and not ignoreInvalid
:return: list of found rule names
r<EFBFBD>FNr<4E>r<>s&&& r<00>disable<6C> Ruler.disable<6C>s<><00><00> <16>e<EFBFBD>S<EFBFBD> !<21> !<21><1A>G<EFBFBD>E<EFBFBD><13><06><19>D<EFBFBD><16>-<2D>-<2D><04>%<25>C<EFBFBD><13>a<EFBFBD><07>]<5D><18><13>a<EFBFBD><07><1D><1E>!B<>4<EFBFBD>&<26>I<>J<>J<>*/<2F>D<EFBFBD>N<EFBFBD>N<EFBFBD>3<EFBFBD> <1F> '<27> <12>M<EFBFBD>M<EFBFBD>$<24> <1F><1A><1E><04><0E><15> rc<01> <00>V^8<>dQhRRRR/#)r<00> chainNamerr zlist[RuleFuncTv]r)rs"rrrS<00>s<00><00> 7<> 7<>#<23> 7<>/?<3F> 7rc <0A><><00>VPf!VP4VPfQhVPPV.4;'g.#)aReturn array of active functions (rules) for given chain name.
It analyzes rules configuration, compiles caches if not exists and returns result.
Default chain name is `''` (empty string). It can't be skipped.
That's done intentionally, to keep signature monomorphic for high speed.
)rVrhrr)rr<>s&&r<00>getRules<65>Ruler.getRules<65>sI<00><00> <10>><3E>><3E> !<21> <10> <1C> <1C> <1E><17>><3E>><3E>-<2D> -<2D>-<2D><13>~<7E>~<7E>!<21>!<21>)<29>R<EFBFBD>0<>6<>6<>B<EFBFBD>6rc<01><00>V^8<>dQhRR/#<00>rr rBr)rs"rrrS s<00><00>0<>0<>y<EFBFBD>0rc <0A>V<00>VPUu.uFqPNK up#uupi)z Return all available rule names.)rUrJ<00>r<00>rs& r<00> get_all_rules<65>Ruler.get_all_rules s <00><00> $<24><0E><0E>/<2F><0E>1<EFBFBD><06><06><0E>/<2F>/<2F><>/s<00>&c<01><00>V^8<>dQhRR/#r<>r)rs"rrrSs<00><00>=<3D>=<3D>)<29>=rc <0A>~<00>VPUu.uF"qP'gKVPNK$ up#uupi)zReturn the active rule names.)rUrLrJr<>s& r<00>get_active_rules<65>Ruler.get_active_ruless(<00><00> $<24><0E><0E><<3C><0E>1<EFBFBD>)<29>)<29><06><01><06><06><0E><<3C><<3C><><s<00>:<04>:)rVrUr)F)rc)r9r:r;r<rr_rhrtr{r<>r<>r<>r<>r<>r<>r<>r<>r?rrrrPrPKsI<00><00>B<01><12>6<>&<1E>$<1E>0<1E>0 <1E><16>01<> <16>0 7<>0<>=<3D>=rrP)<17>__doc__<5F>
__future__r<00>collections.abcr<00> dataclassesrr<00>typingrrrr r3<00>utilsr
<00> markdown_itr r rArFrIrPrrr<00><module>r<>s<><00><01><04>$#<23>$<24>(<28>=<3D>=<3D><0F><1A><10>&<26>!<21>!<21>6<13>i<EFBFBD>u<EFBFBD><13><15>\<5C> "<22>
<EFBFBD>F<> <0B><14><16><13>7<EFBFBD>:<3A> <1E><13><17><13>H=<3D>G<EFBFBD>J<EFBFBD> <1F>H=r