ó
    ›ökj—–  ã                  ó*  • S r SSKJr  SSKJr  SSKJrJrJrJ	r	  SSK
r
SSKJs  Jr  SSKJr  \(       a  SSKJr  SPS	 jrS
r Sr Sr Sr Sr Sr Sr Sr Sr Sr Sr Sr Sr \S-   r  Sr! \ r" \!r# Sr$ Sr% Sr& Sr' Sr( Sr) SQS jr* " S  S!\	5      r+ " S" S#5      r, " S$ S%\,5      r- " S& S'\,5      r. " S( S)\-5      r/ " S* S+\-5      r0 " S, S-\,5      r1 " S. S/\-5      r2 " S0 S1\15      r3 " S2 S3\25      r4 " S4 S5\-5      r5 " S6 S7\15      r6 " S8 S9\25      r7 " S: S;\-5      r8 " S< S=\-5      r9 " S> S?\95      r: " S@ SA\-5      r; " SB SC\;5      r< " SD SE\;5      r= " SF SG\=5      r> " SH SI\=5      r? " SJ SK\?5      r@ " SL SM\-5      rA " SN SO\-5      rBg)RaB  
In version 3.0, a new, more flexible inline processor was added, [`markdown.inlinepatterns.InlineProcessor`][].   The
original inline patterns, which inherit from [`markdown.inlinepatterns.Pattern`][] or one of its children are still
supported, though users are encouraged to migrate.

The new `InlineProcessor` provides two major enhancements to `Patterns`:

1. Inline Processors no longer need to match the entire block, so regular expressions no longer need to start with
  `r'^(.*?)'` and end with `r'(.*?)%'`. This runs faster. The returned [`Match`][re.Match] object will only contain
   what is explicitly matched in the pattern, and extension pattern groups now start with `m.group(1)`.

2.  The `handleMatch` method now takes an additional input called `data`, which is the entire block under analysis,
    not just what is matched with the specified pattern. The method now returns the element *and* the indexes relative
    to `data` that the return element is replacing (usually `m.start(0)` and `m.end(0)`).  If the boundaries are
    returned as `None`, it is assumed that the match did not take place, and nothing will be altered in `data`.

    This allows handling of more complex constructs than regular expressions can handle, e.g., matching nested
    brackets, and explicit control of the span "consumed" by the processor.

é    )Úannotationsé   )Úutil)ÚTYPE_CHECKINGÚAnyÚ
CollectionÚ
NamedTupleN)Úentities)ÚMarkdownc                ó8  • [         R                  " 5       nUR                  [        [        5      SS5        UR                  [        [        U 5      SS5        UR                  [        [        U 5      SS5        UR                  [        [        U 5      SS5        UR                  [        [        U 5      S	S
5        UR                  [        [        U 5      SS5        UR                  [        [        U 5      SS5        UR                  [!        [        U 5      SS5        UR                  [#        [$        U 5      SS5        UR                  ['        [(        U 5      SS5        UR                  [+        [,        S5      SS5        UR                  [/        [0        U 5      SS5        UR                  [/        [2        U 5      SS5        UR                  [5        [6        5      SS5        UR                  [9        S5      SS 5        UR                  [;        S!5      S"S#5        U$ )$aì  
Build the default set of inline patterns for Markdown.

The order in which processors and/or patterns are applied is very important - e.g. if we first replace
`http://.../` links with `<a>` tags and _then_ try to replace inline HTML, we would end up with a mess. So, we
apply the expressions in the following order:

* backticks and escaped characters have to be handled before everything else so that we can preempt any markdown
  patterns by escaping them;

* then we handle the various types of links (auto-links must be handled before inline HTML);

* then we handle inline HTML.  At this point we will simply replace all inline HTML strings with a placeholder
  and add the actual HTML to a stash;

* finally we apply strong, emphasis, etc.

Úbacktické¾   Úescapeé´   Ú	referenceéª   Úlinké    Ú
image_linké–   Úimage_referenceéŒ   Úshort_referenceé‚   Úshort_image_refé}   Úautolinkéx   Úautomailén   ÚbrÚ	linebreakéd   ÚhtmléZ   ÚentityéP   Ú
not_strongéF   z\*Ú	em_strongé<   Ú_Ú
em_strong2é2   )r   ÚRegistryÚregisterÚBacktickInlineProcessorÚBACKTICK_REÚEscapeInlineProcessorÚ	ESCAPE_REÚReferenceInlineProcessorÚREFERENCE_REÚLinkInlineProcessorÚLINK_REÚImageInlineProcessorÚIMAGE_LINK_REÚImageReferenceInlineProcessorÚIMAGE_REFERENCE_REÚShortReferenceInlineProcessorÚ"ShortImageReferenceInlineProcessorÚAutolinkInlineProcessorÚAUTOLINK_REÚAutomailInlineProcessorÚAUTOMAIL_REÚSubstituteTagInlineProcessorÚLINE_BREAK_REÚHtmlInlineProcessorÚHTML_REÚ	ENTITY_REÚSimpleTextInlineProcessorÚNOT_STRONG_REÚAsteriskProcessorÚUnderscoreProcessor)ÚmdÚkwargsÚinlinePatternss      Ú¥C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\markdown/inlinepatterns.pyÚbuild_inlinepatternsrP   5   sÆ  € ô& —]’]“_€NØ×ÑÔ3´KÓ@À*ÈcÔRØ×ÑÔ1´)¸RÓ@À(ÈCÔPØ×ÑÔ4´\À2ÓFÈÐUXÔYØ×ÑÔ/´¸Ó<¸fÀcÔJØ×ÑÔ0´ÀÓCÀ\ÐSVÔWØ×ÑÜ%Ô&8¸"Ó=Ð?PÐRUôð ×ÑÜ%¤l°BÓ7Ð9JÈCôð ×ÑÜ*Ô+=¸rÓBÐDUÐWZôð ×ÑÔ3´KÀÓDÀjÐRUÔVØ×ÑÔ3´KÀÓDÀjÐRUÔVØ×ÑÔ8¼ÈÓMÈ{Ð\_Ô`Ø×ÑÔ/´¸Ó<¸fÀbÔIØ×ÑÔ/´	¸2Ó>ÀÈ"ÔMØ×ÑÔ5´mÓDÀlÐTVÔWØ×ÑÔ-¨eÓ4°kÀ2ÔFØ×ÑÔ/°Ó5°|ÀRÔHØÐó    z(?<!\!)z;(?:(?<!\\)((?:\\{2})+)(?=`+)|(?<!\\)(`+)(.+?)(?<!`)\2(?!`))z\\(.)z(\*)([^\*]+)\1z(\*{2})(.+?)\1z%(?<!\w)(_{2})(?!_)(.+?)(?<!_)\1(?!\w)z"(?<!\w)(_)(?!_)(.+?)(?<!_)\1(?!\w)z7(?<!\w)(\_)\1(?!\1)(.+?)(?<!\w)\1(?!\1)(.+?)\1{3}(?!\w)z(\*)\1{2}(.+?)\1(.*?)\1{2}z(_)\1{2}(.+?)\1(.*?)\1{2}z(\*)\1{2}(.+?)\1{2}(.*?)\1z(_)\1{2}(.+?)\1{2}(.*?)\1z&(\*)\1(?!\1)([^*]+?)\1(?!\1)(.+?)\1{3}z\[z\!\[z%((^|(?<=\s))(\*{1,3}|_{1,3})(?=\s|$))z+<((?:[Ff]|[Hh][Tt])[Tt][Pp][Ss]?://[^<>]*)>z<([^<> !]+@[^@<> ]+)>z(<(\/?[a-zA-Z][^<>@ ]*( [^<>]*)?|!--(?:(?!<!--|-->).)*--|[?](?:(?!<[?]|[?]>).)*[?]|!\[CDATA\[(?:(?!<!\[CDATA\[|\]\]>).)*\]\])>)z-(&(?:\#[0-9]+|\#x[0-9a-fA-F]+|[a-zA-Z0-9]+);)z  \nc                óÀ   • U R                  S5      (       a  U R                  S5      (       d,  U R                  S5      (       a  U R                  S5      (       a  U SS $ U $ )z#Remove quotes from around a string.Ú"Ú'r   éÿÿÿÿ)Ú
startswithÚendswith)Ústrings    rO   ÚdequoterY   ±   sQ   € à	×	Ñ	˜3×	Ñ	 F§O¡O°C×$8Ñ$8Ø×Ñ˜#×Ñ 6§?¡?°3×#7Ñ#7Ø�a˜ˆ|ÐàˆrQ   c                  ó8   • \ rS rSr% SrS\S'   S\S'   S\S'   Srg	)
ÚEmStrongIteméº   zEmphasis/strong pattern item.úre.Pattern[str]ÚpatternÚstrÚbuilderÚtags© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__Ú__static_attributes__rb   rQ   rO   r[   r[   º   s   ‡ Ù'ØÓØƒLØ
†IrQ   r[   c                  ó~   • \ rS rSr% Sr\" 5       rS\S'    S\S'   S\S'   SSS
 jjrSS jr	SS jr
SS jrSS jrSrg	)ÚPatternéÅ   a¹  
Base class that inline patterns subclass.

Inline patterns are handled by means of `Pattern` subclasses, one per regular expression.
Each pattern object uses a single regular expression and must support the following methods:
[`getCompiledRegExp`][markdown.inlinepatterns.Pattern.getCompiledRegExp] and
[`handleMatch`][markdown.inlinepatterns.Pattern.handleMatch].

All the regular expressions used by `Pattern` subclasses must capture the whole block.  For this
reason, they all start with `^(.*)` and end with `(.*)!`.  When passing a regular expression on
class initialization, the `^(.*)` and `(.*)!` are added automatically and the regular expression
is pre-compiled.

It is strongly suggested that the newer style [`markdown.inlinepatterns.InlineProcessor`][] that
use a more efficient and flexible search approach be used instead. However, the older style
`Pattern` remains for backward compatibility with many existing third-party extensions.

zCollection[str]ÚANCESTOR_EXCLUDESr]   Úcompiled_reúMarkdown | NonerL   Nc                ó˜   • Xl         [        R                  " SU-  [        R                  [        R                  -  5      U l        X l        g)zñ
Create an instant of an inline pattern.

Arguments:
    pattern: A regular expression that matches a pattern.
    md: An optional pointer to the instance of `markdown.Markdown` and is available as
        `self.md` on the class instance.


z^(.*?)%s(.*)$N)r^   ÚreÚcompileÚDOTALLÚUNICODErn   rL   ©Úselfr^   rL   s      rO   Ú__init__ÚPattern.__init__â   s9   € ð ŒÜŸ:š:Ð&6¸Ñ&@Ü&(§i¡i´"·*±*Ñ&<ó>ˆÔð �rQ   c                ó   • U R                   $ )z&Return a compiled regular expression. )rn   ©rv   s    rO   ÚgetCompiledRegExpÚPattern.getCompiledRegExpó   s   € à×ÑÐrQ   c                ó   • g)zËReturn a ElementTree element from the given match.

Subclasses should override this method.

Arguments:
    m: A match object containing a match of the pattern.

Returns: An ElementTree Element object.

Nrb   ©rv   Úms     rO   ÚhandleMatchÚPattern.handleMatch÷   s   € ð 	rQ   c                ó.   • U R                   R                  $ )z*Return class name, to define pattern type )Ú	__class__rc   rz   s    rO   ÚtypeÚPattern.type  s   € à�~‰~×&Ñ&Ð&rQ   c                óº   ^•  U R                   R                  S   R                  mU4S jn[        R
                  R                  X!5      $ ! [         a    Us $ f = f)ú=Return unescaped text given text with an inline placeholder. Úinlinec                óÂ   >• U R                  S5      nUT;   aG  TR                  U5      n[        U[        5      (       a  U$ SR	                  UR                  5       5      $ g )Nr   Ú )ÚgroupÚgetÚ
isinstancer_   ÚjoinÚitertext)r   ÚidÚvalueÚstashs      €rO   Ú	get_stashÚ#Pattern.unescape.<locals>.get_stash  sS   ø€ Ø—‘˜“ˆBØ�U‹{ØŸ	™	 "›�Ü˜e¤S×)Ñ)Ø �Lð Ÿ7™7 5§>¡>Ó#3Ó4Ð4ð rQ   ©rL   ÚtreeprocessorsÚstashed_nodesÚKeyErrorr   ÚINLINE_PLACEHOLDER_REÚsub©rv   Útextr“   r’   s      @rO   ÚunescapeÚPattern.unescape  sV   ø€ ð	Ø—G‘G×*Ñ*¨8Ñ4×BÑBˆEõ	5ô ×)Ñ)×-Ñ-¨iÓ>Ð>øô ó 	ØŠKð	ús   ƒ#A ÁAÁA)rn   rL   r^   ©N©r^   r_   rL   ro   )Úreturnz
re.Pattern)r   úre.Match[str]r¡   zetree.Element | str)r¡   r_   ©rœ   r_   r¡   r_   )rc   rd   re   rf   rg   Útuplerm   rh   rw   r{   r€   r„   r�   ri   rb   rQ   rO   rk   rk   Å   sB   ‡ ññ& */«Ð�Ó0ðð
 !Ó ØÓöô" ôô'÷?rQ   rk   c                  ó0   • \ rS rSrSrSSS jjrS	S jrSrg)
ÚInlineProcessori  z‘
Base class that inline processors subclass.

This is the newer style inline processor that uses a more
efficient and flexible search approach.

Nc                ó    • Xl         [        R                  " U[        R                  [        R                  -  5      U l        SU l        X l        g)zò
Create an instant of an inline processor.

Arguments:
    pattern: A regular expression that matches a pattern.
    md: An optional pointer to the instance of `markdown.Markdown` and is available as
        `self.md` on the class instance.

FN)r^   rq   rr   rs   rt   rn   Ú	safe_moderL   ru   s      rO   rw   ÚInlineProcessor.__init__$  s7   € ð ŒÜŸ:š: g¬r¯y©y¼2¿:¹:Ñ/EÓFˆÔð ˆŒØ�rQ   c                ó   • g)a9  Return a ElementTree element from the given match and the
start and end index of the matched text.

If `start` and/or `end` are returned as `None`, it will be
assumed that the processor did not find a valid region of text.

Subclasses should override this method.

Arguments:
    m: A re match object containing a match of the pattern.
    data: The buffer currently under analysis.

Returns:
    el: The ElementTree element, text or None.
    start: The start of the region that has been matched or None.
    end: The end of the region that has been matched or None.

Nrb   ©rv   r   Údatas      rO   r€   ÚInlineProcessor.handleMatch5  s   € ð& 	rQ   )rn   rL   r^   r¨   rŸ   r    )r   r¢   r¬   r_   r¡   z9tuple[etree.Element | str | None, int | None, int | None]©rc   rd   re   rf   rg   rw   r€   ri   rb   rQ   rO   r¦   r¦     s   † ñö÷"rQ   r¦   c                  ó"   • \ rS rSrSrSS jrSrg)ÚSimpleTextPatterniK  z1Return a simple text of `group(2)` of a Pattern. c                ó$   • UR                  S5      $ )z;Return string content of `group(2)` of a matching pattern. é   )r‹   r~   s     rO   r€   ÚSimpleTextPattern.handleMatchM  s   € à�w‰w�q‹zÐrQ   rb   N©r   r¢   r¡   r_   ©rc   rd   re   rf   rg   r€   ri   rb   rQ   rO   r°   r°   K  s
   † Ù<÷rQ   r°   c                  ó"   • \ rS rSrSrSS jrSrg)rH   iR  z1Return a simple text of `group(1)` of a Pattern. c                óf   • UR                  S5      UR                  S5      UR                  S5      4$ )z;Return string content of `group(1)` of a matching pattern. r   r   )r‹   ÚstartÚendr«   s      rO   r€   Ú%SimpleTextInlineProcessor.handleMatchT  s'   € à�w‰w�q‹z˜1Ÿ7™7 1›: q§u¡u¨Q£xÐ/Ð/rQ   rb   N©r   r¢   r¬   r_   r¡   ztuple[str, int, int]rµ   rb   rQ   rO   rH   rH   R  s
   † Ù<÷0rQ   rH   c                  ó"   • \ rS rSrSrSS jrSrg)r3   iY  zReturn an escaped character. c                óN  • UR                  S5      nX0R                  R                  ;   aY  SR                  [        R
                  [        U5      [        R                  5      UR                  S5      UR                  S5      4$ SUR                  S5      UR                  S5      4$ )a�  
If the character matched by `group(1)` of a pattern is in [`ESCAPED_CHARS`][markdown.Markdown.ESCAPED_CHARS]
then return the integer representing the character's Unicode code point (as returned by [`ord`][]) wrapped
in [`util.STX`][markdown.util.STX] and [`util.ETX`][markdown.util.ETX].

If the matched character is not in [`ESCAPED_CHARS`][markdown.Markdown.ESCAPED_CHARS], then return `None`.
r   ú{}{}{}r   N)
r‹   rL   ÚESCAPED_CHARSÚformatr   ÚSTXÚordÚETXr¸   r¹   )rv   r   r¬   Úchars       rO   r€   Ú!EscapeInlineProcessor.handleMatch\  su   € ð �w‰w�q‹zˆØ—7‘7×(Ñ(Ó(Ø—?‘?¤4§8¡8¬S°«Y¼¿¹ÓAÀ1Ç7Á7È1Ã:ÈqÏuÉuÐUVËxÐWÐWà˜Ÿ™ › Q§U¡U¨1£XÐ-Ð-rQ   rb   N)r   r¢   r¬   r_   r¡   ztuple[str | None, int, int]rµ   rb   rQ   rO   r3   r3   Y  s
   † Ù(÷.rQ   r3   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	ÚSimpleTagPatternil  zQ
Return element of type `tag` with a text attribute of `group(3)`
of a Pattern.

c                ó:   • [         R                  X5        X l        g)z�
Create an instant of an simple tag pattern.

Arguments:
    pattern: A regular expression that matches a pattern.
    tag: Tag of element.

N)rk   rw   Útag©rv   r^   rÉ   s      rO   rw   ÚSimpleTagPattern.__init__r  s   € ô 	×Ñ˜Ô'ØŒØ0rQ   c                ór   • [         R                  " U R                  5      nUR                  S5      Ul        U$ )zŒ
Return [`Element`][xml.etree.ElementTree.Element] of type `tag` with the string in `group(3)` of a
matching pattern as the Element's text.
é   )ÚetreeÚElementrÉ   r‹   rœ   )rv   r   Úels      rO   r€   ÚSimpleTagPattern.handleMatch  s*   € ô
 �]Š]˜4Ÿ8™8Ó$ˆØ—'‘'˜!“*ˆŒØˆ	rQ   ©rÉ   N©r^   r_   rÉ   r_   ©r   r¢   r¡   úetree.Elementr®   rb   rQ   rO   rÇ   rÇ   l  s   † ñô
1÷rQ   rÇ   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	ÚSimpleTagInlineProcessori‰  zQ
Return element of type `tag` with a text attribute of `group(2)`
of a Pattern.

c                ó:   • [         R                  X5        X l        g)z�
Create an instant of an simple tag processor.

Arguments:
    pattern: A regular expression that matches a pattern.
    tag: Tag of element.

N)r¦   rw   rÉ   rÊ   s      rO   rw   Ú!SimpleTagInlineProcessor.__init__�  s   € ô 	× Ñ  Ô/ØŒØ0rQ   c                ó²   • [         R                  " U R                  5      nUR                  S5      Ul        X1R                  S5      UR                  S5      4$ )zŒ
Return [`Element`][xml.etree.ElementTree.Element] of type `tag` with the string in `group(2)` of a
matching pattern as the Element's text.
r²   r   )rÎ   rÏ   rÉ   r‹   rœ   r¸   r¹   ©rv   r   r¬   rÐ   s       rO   r€   Ú$SimpleTagInlineProcessor.handleMatchœ  s@   € ô
 �]Š]˜4Ÿ8™8Ó$ˆØ—'‘'˜!“*ˆŒØ—7‘7˜1“:˜qŸu™u Q›xÐ'Ð'rQ   rÒ   NrÓ   ©r   r¢   r¬   r_   r¡   ztuple[etree.Element, int, int]r®   rb   rQ   rO   r×   r×   ‰  s   † ñô
1÷(rQ   r×   c                  ó"   • \ rS rSrSrSS jrSrg)ÚSubstituteTagPatterni¦  ú2Return an element of type `tag` with no children. c                óB   • [         R                  " U R                  5      $ )úGReturn empty [`Element`][xml.etree.ElementTree.Element] of type `tag`. )rÎ   rÏ   rÉ   r~   s     rO   r€   Ú SubstituteTagPattern.handleMatch¨  s   € ä�}Š}˜TŸX™XÓ&Ð&rQ   rb   NrÔ   rµ   rb   rQ   rO   rß   rß   ¦  s
   † Ù=÷'rQ   rß   c                  ó"   • \ rS rSrSrSS jrSrg)rC   i­  rà   c                ó„   • [         R                  " U R                  5      UR                  S5      UR	                  S5      4$ )râ   r   )rÎ   rÏ   rÉ   r¸   r¹   r«   s      rO   r€   Ú(SubstituteTagInlineProcessor.handleMatch¯  s,   € ä�}Š}˜TŸX™XÓ&¨¯©°«
°A·E±E¸!³HÐ<Ð<rQ   rb   NrÝ   rµ   rb   rQ   rO   rC   rC   ­  s
   † Ù=÷=rQ   rC   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	r1   i´  z@Return a `<code>` element containing the escaped matching text. c                ó¶   • [         R                  X5        SR                  [        R                  [        S5      [        R                  5      U l        SU l        g )Nr¾   Ú\Úcode)	r¦   rw   rÀ   r   rÁ   rÂ   rÃ   ÚESCAPED_BSLASHrÉ   )rv   r^   s     rO   rw   Ú BacktickInlineProcessor.__init__¶  s;   € Ü× Ñ  Ô/Ø&Ÿo™o¬d¯h©h¼¸D»	Ä4Ç8Á8ÓLˆÔØˆŒØ0rQ   c                óâ  • UR                  S5      (       aŽ  [        R                  " U R                  5      n[        R
                  " [        R                  " UR                  S5      R                  5       5      5      Ul        X1R                  S5      UR                  S5      4$ UR                  S5      R                  SU R                  5      UR                  S5      UR                  S5      4$ )aX  
If the match contains `group(3)` of a pattern, then return a `code`
[`Element`][xml.etree.ElementTree.Element] which contains HTML escaped text (with
[`code_escape`][markdown.util.code_escape]) as an [`AtomicString`][markdown.util.AtomicString].

If the match does not contain `group(3)` then return the text of `group(1)` backslash escaped.

rÍ   r   r   z\\)r‹   rÎ   rÏ   rÉ   r   ÚAtomicStringÚcode_escapeÚstriprœ   r¸   r¹   Úreplacerë   rÛ   s       rO   r€   Ú#BacktickInlineProcessor.handleMatch¼  s©   € ð �7‰7�1�:‰:Ü—’˜tŸx™xÓ(ˆBÜ×'Ò'¬×(8Ò(8¸¿¹À»×9IÑ9IÓ9KÓ(LÓMˆBŒGØ—w‘w˜q“z 1§5¡5¨£8Ð+Ð+à—7‘7˜1“:×%Ñ% f¨d×.AÑ.AÓBÀAÇGÁGÈAÃJÐPQ×PUÑPUÐVWÓPXÐXÐXrQ   )rë   rÉ   N)r^   r_   )r   r¢   r¬   r_   r¡   z$tuple[etree.Element | str, int, int]r®   rb   rQ   rO   r1   r1   ´  s   † ÙKô1÷YrQ   r1   c                  ó"   • \ rS rSrSrSS jrSrg)ÚDoubleTagPatterniÍ  ú^Return a ElementTree element nested in tag2 nested in tag1.

Useful for strong emphasis etc.

c                ó*  • U R                   R                  S5      u  p#[        R                  " U5      n[        R                  " XC5      nUR                  S5      Ul        [        UR                  5       5      S:X  a  UR                  S5      Ul	        U$ )z”
Return [`Element`][xml.etree.ElementTree.Element] in following format:
`<tag1><tag2>group(3)</tag2>group(4)</tag2>` where `group(4)` is optional.

Ú,rÍ   é   é   )
rÉ   ÚsplitrÎ   rÏ   Ú
SubElementr‹   rœ   ÚlenÚgroupsÚtail)rv   r   Útag1Útag2Úel1Úel2s         rO   r€   ÚDoubleTagPattern.handleMatchÓ  sk   € ð —X‘X—^‘^ CÓ(‰
ˆÜ�mŠm˜DÓ!ˆÜ×Ò˜sÓ)ˆØ—7‘7˜1“:ˆŒÜˆq�x‰x‹z‹?˜aÓØ—w‘w˜q“zˆCŒHØˆ
rQ   rb   NrÔ   rµ   rb   rQ   rO   rô   rô   Í  s   † ñ÷
rQ   rô   c                  ó"   • \ rS rSrSrSS jrSrg)ÚDoubleTagInlineProcessoriâ  rõ   c                ój  • U R                   R                  S5      u  p4[        R                  " U5      n[        R                  " XT5      nUR                  S5      Ul        [        UR                  5       5      S:X  a  UR                  S5      Ul	        XQR                  S5      UR                  S5      4$ )z”
Return [`Element`][xml.etree.ElementTree.Element] in following format:
`<tag1><tag2>group(2)</tag2>group(3)</tag2>` where `group(3)` is optional.

r÷   r²   rÍ   r   )rÉ   rú   rÎ   rÏ   rû   r‹   rœ   rü   rý   rþ   r¸   r¹   )rv   r   r¬   rÿ   r   r  r  s          rO   r€   Ú$DoubleTagInlineProcessor.handleMatchè  s�   € ð —X‘X—^‘^ CÓ(‰
ˆÜ�mŠm˜DÓ!ˆÜ×Ò˜sÓ)ˆØ—7‘7˜1“:ˆŒÜˆq�x‰x‹z‹?˜aÓØ—w‘w˜q“zˆCŒHØ—G‘G˜A“J §¡ a£Ð(Ð(rQ   rb   NrÝ   rµ   rb   rQ   rO   r  r  â  s   † ñ÷
)rQ   r  c                  ó6   • \ rS rSrSrSS jrS	S jrS	S jrSrg)
rE   i÷  z0Store raw inline html and return a placeholder. c                óî   • U R                  U R                  UR                  S5      5      5      nU R                  R                  R                  U5      nXAR                  S5      UR                  S5      4$ )zKStore the text of `group(1)` of a pattern and return a placeholder string. r   r   )Úbackslash_unescaper�   r‹   rL   Ú	htmlStashÚstorer¸   r¹   )rv   r   r¬   ÚrawhtmlÚplace_holders        rO   r€   ÚHtmlInlineProcessor.handleMatchù  sX   € à×)Ñ)¨$¯-©-¸¿¹À»
Ó*CÓDˆØ—w‘w×(Ñ(×.Ñ.¨wÓ7ˆØŸW™W Q›Z¨¯©¨q«Ð1Ð1rQ   c                óÂ   ^ ^•  T R                   R                  S   R                  mSU U4S jjn[        R
                  R                  X!5      $ ! [         a    Us $ f = f)r‡   rˆ   c                óÐ   >• U R                  S5      nTR                  U5      nUb+   TR                  TR                  R	                  U5      5      $ g ! [
         a    SU-  s $ f = f)Nr   z\%s)r‹   rŒ   r�   rL   Ú
serializerÚ	Exception)r   r�   r‘   rv   r’   s      €€rO   r“   Ú/HtmlInlineProcessor.unescape.<locals>.get_stash  sf   ø€ Ø—‘˜“ˆBØ—I‘I˜b“MˆEØÑ ð*àŸ=™=¨¯©×);Ñ);¸EÓ)BÓCÐCð !øô !ó *Ø! E™>Ò)ð*ús   ¨)A ÁA%Á$A%r´   r•   r›   s   `  @rO   r�   ÚHtmlInlineProcessor.unescapeÿ  s[   ù€ ð	Ø—G‘G×*Ñ*¨8Ñ4×BÑBˆE÷	*ð 	*ô ×)Ñ)×-Ñ-¨iÓ>Ð>øô ó 	ØŠKð	ús   „#A ÁAÁAc                óš   •  U R                   R                  S   R                  nSS jnUR	                  X15      $ ! [         a    Us $ f = f)zFReturn text with backslash escapes undone (backslashes are restored). r�   c                óH   • [        [        U R                  S5      5      5      $ )Nr   )ÚchrÚintr‹   )r   s    rO   Ú	_unescapeÚ9HtmlInlineProcessor.backslash_unescape.<locals>._unescape  s   € Ü”s˜1Ÿ7™7 1›:“Ó'Ð'rQ   r´   )rL   r–   ÚREr˜   rš   )rv   rœ   r  r  s       rO   r
  Ú&HtmlInlineProcessor.backslash_unescape  sM   € ð	Ø—‘×'Ñ'¨
Ñ3×6Ñ6ˆBô	(ð �v‰v�iÓ&Ð&øô ó 	ØŠKð	ús   ‚#; »A
Á	A
rb   Nr»   r£   )	rc   rd   re   rf   rg   r€   r�   r
  ri   rb   rQ   rO   rE   rE   ÷  s   † Ù;ô2ô?÷&
'rQ   rE   c                  óX  • \ rS rSrSr\" \R                  " \\R                  \R                  -  5      SS5      \" \R                  " \\R                  \R                  -  5      SS5      \" \R                  " \\R                  \R                  -  5      SS5      \" \R                  " \\R                  \R                  -  5      SS5      \" \R                  " \\R                  \R                  -  5      SS	5      /r SS
 jrSS jrSS jr          SS jrSS jrSS jrSrg)rJ   i  zGEmphasis processor for handling strong and em matches inside asterisks.Údoubleú	strong,emú	em,strongÚdouble2ÚsingleÚstrongÚemc                óz   • [         R                  " U5      nUR                  S5      nU R                  XTSU5        U$ )zReturn single tag.r²   N)rÎ   rÏ   r‹   Úparse_sub_patterns)rv   r   rÉ   Úidxr  rœ   s         rO   Úbuild_singleÚAsteriskProcessor.build_single+  s4   € ä�mŠm˜CÓ ˆØ�w‰w�q‹zˆØ×Ñ ¨4°Ô5Øˆ
rQ   c                ón  • UR                  S5      u  pE[        R                  " U5      n[        R                  " U5      nUR                  S5      nU R	                  X‡SU5        UR                  U5        [        UR                  5       5      S:X  a#  UR                  S5      nU R	                  X†Xs5        U$ )zReturn double tag.r÷   r²   NrÍ   )rú   rÎ   rÏ   r‹   r'  Úappendrü   rý   ©	rv   r   ra   r(  rÿ   r   r  r  rœ   s	            rO   Úbuild_doubleÚAsteriskProcessor.build_double2  s�   € ð —Z‘Z “_‰
ˆÜ�mŠm˜DÓ!ˆÜ�mŠm˜DÓ!ˆØ�w‰w�q‹zˆØ×Ñ ¨4°Ô5Ø�
‰
�3ŒÜˆq�x‰x‹z‹?˜aÓØ—7‘7˜1“:ˆDØ×#Ñ# D¨sÔ8Øˆ
rQ   c                ó6  • UR                  S5      u  pE[        R                  " U5      n[        R                  " U5      nUR                  S5      nU R	                  X†SU5        UR                  S5      nUR                  U5        U R	                  X‡SU5        U$ )zFReturn double tags (variant 2): `<strong>text <em>text</em></strong>`.r÷   r²   NrÍ   )rú   rÎ   rÏ   r‹   r'  r,  r-  s	            rO   Úbuild_double2ÚAsteriskProcessor.build_double2@  s}   € ð —Z‘Z “_‰
ˆÜ�mŠm˜DÓ!ˆÜ�mŠm˜DÓ!ˆØ�w‰w�q‹zˆØ×Ñ ¨4°Ô5Ø�w‰w�q‹zˆØ�
‰
�3ŒØ×Ñ ¨4°Ô5Øˆ
rQ   c                ó\  • SnSn[        U5      nXg:  aü  U R                  R                  X5      (       aÐ  Sn[        U R                  5       H¨  u  pšX”::  a  M  U
R
                  R                  X5      nU(       d  M0  XUR                  S5       nU(       a  Ub  XÃl        OXÂl        U R                  XºR                  U
R                  U	5      nUR                  U5        UnUR                  S5      =pVSnMª     U(       d  US-  nOUS-  nXg:  a  Mü  XS nU(       a  Ub  XÃl        gXÂl        gg)zÿ
Parses sub patterns.

`data`: text to evaluate.

`parent`: Parent to attach text and sub elements to.

`last`: Last appended child to parent. Can also be None if parent has no children.

`idx`: Current pattern index that was used to evaluate the parent.
r   FNTr   )rü   rn   ÚmatchÚ	enumerateÚPATTERNSr^   r¸   rþ   rœ   Úbuild_elementr`   ra   r,  r¹   )rv   r¬   ÚparentÚlastr(  ÚoffsetÚposÚlengthÚmatchedÚindexÚitemr   rœ   rÐ   s                 rO   r'  Ú$AsteriskProcessor.parse_sub_patternsM  s  € ð ˆØˆä�T“ˆØ‹là×Ñ×%Ñ% d×0Ñ0Ø�ä#,¨T¯]©]Ö#;‘K�Eà“|Ù ØŸ™×*Ñ*¨4Ó5�Aß�qð
  $¨1¯7©7°1«:Ð6˜ÞØ#Ñ/Ø,0¥	à.2¤Ø!×/Ñ/°·<±<ÀÇÁÈEÓR˜ØŸ™ bÔ)Ø!˜à'(§u¡u¨Q£xÐ/˜Ø"&šñ+ $<ö, à˜1‘H�Cøð �q‘�ðA �lðF �Gˆ}ˆÞØÑØ •	à"•ð	 rQ   c                ó†   • US:X  a  U R                  XU5      $ US:X  a  U R                  XU5      $ U R                  XU5      $ )zElement builder.r"  r  )r1  r.  r)  )rv   r   r`   ra   r>  s        rO   r7  ÚAsteriskProcessor.build_elementŠ  sM   € ð �iÓØ×%Ñ% a¨uÓ5Ð5Ø˜Ó Ø×$Ñ$ Q¨eÓ4Ð4à×$Ñ$ Q¨eÓ4Ð4rQ   c                óJ  • SnSnSn[        U R                  5       H�  u  pgUR                  R                  X!R	                  S5      5      nU(       d  M8  UR	                  S5      nUR                  S5      nU R                  X‡R                  UR                  U5      n  O   X4U4$ )zParse patterns.Nr   )	r5  r6  r^   r4  r¸   r¹   r7  r`   ra   )	rv   r   r¬   rÐ   r¸   r¹   r>  r?  Úm1s	            rO   r€   ÚAsteriskProcessor.handleMatch”  sŽ   € ð ˆØˆØˆä$ T§]¡]Ö3‰KˆEØ—‘×#Ñ# D¯'©'°!«*Ó5ˆBßˆrØŸ™ ›�Ø—f‘f˜Q“i�Ø×'Ñ'¨¯L©L¸$¿)¹)ÀUÓK�Ùñ 4ð ˜#ˆ~ÐrQ   rb   N)r   r¢   rÉ   r_   r(  r  r¡   rÕ   )r   r¢   ra   r_   r(  r  r¡   rÕ   )
r¬   r_   r8  rÕ   r9  zetree.Element | Noner(  r  r¡   ÚNone)
r   r¢   r`   r_   ra   r_   r>  r  r¡   rÕ   ©r   r¢   r¬   r_   r¡   z3tuple[etree.Element | None, int | None, int | None])rc   rd   re   rf   rg   r[   rq   rr   ÚEM_STRONG_RErs   rt   ÚSTRONG_EM_REÚSTRONG_EM3_REÚ	STRONG_REÚEMPHASIS_REr6  r)  r.  r1  r'  r7  r€   ri   rb   rQ   rO   rJ   rJ     s  † ÙQñ 	�R—Z’Z ¨b¯i©i¸"¿*¹*Ñ.DÓEÀxÐQ\Ó]Ù�R—Z’Z ¨b¯i©i¸"¿*¹*Ñ.DÓEÀxÐQ\Ó]Ù�R—Z’Z ¨r¯y©y¸2¿:¹:Ñ/EÓFÈ	ÐS^Ó_Ù�R—Z’Z 	¨2¯9©9°r·z±zÑ+AÓBÀHÈhÓWÙ�R—Z’Z ¨R¯Y©Y¸¿¹Ñ-CÓDÀhÐPTÓUð€Hð Pôôôð;#Øð;#Ø!.ð;#Ø6Jð;#ØQTð;#à	ô;#ôz5÷rQ   rJ   c                  ó  • \ rS rSrSr\" \R                  " \\R                  \R                  -  5      SS5      \" \R                  " \\R                  \R                  -  5      SS5      \" \R                  " \\R                  \R                  -  5      SS5      \" \R                  " \\R                  \R                  -  5      SS5      \" \R                  " \\R                  \R                  -  5      SS	5      /rS
rg)rK   i¥  zIEmphasis processor for handling strong and em matches inside underscores.r  r   r!  r"  r#  r$  r%  rb   N)rc   rd   re   rf   rg   r[   rq   rr   ÚEM_STRONG2_RErs   rt   ÚSTRONG_EM2_REÚSMART_STRONG_EM_REÚSMART_STRONG_REÚSMART_EMPHASIS_REr6  ri   rb   rQ   rO   rK   rK   ¥  sÏ   † ÙSñ 	�R—Z’Z ¨r¯y©y¸2¿:¹:Ñ/EÓFÈÐR]Ó^Ù�R—Z’Z ¨r¯y©y¸2¿:¹:Ñ/EÓFÈÐR]Ó^Ù�R—Z’ZÐ 2°B·I±IÀÇ
Á
Ñ4JÓKÈYÐXcÓdÙ�R—Z’Z °·±¸R¿Z¹ZÑ1GÓHÈ(ÐT\Ó]Ù�R—Z’ZÐ 1°2·9±9¸r¿z¹zÑ3IÓJÈHÐVZÓ[ð€Hò PrQ   rK   c                  ó®   • \ rS rSrSr\R                  " S\R                  \R                  -  5      r	\R                  " S5      r
S
S jrSS jrSS jrSrg	)r7   i²  z,Return a link element from the given match. z2\(\s*(?:(<[^<>]*>)\s*(?:('[^']*'|"[^"]*")\s*)?\))?z\sc                ó<  • U R                  X!R                  S5      5      u  p4nU(       d  gU R                  X$5      u  pgpEU(       d  g[        R                  " S5      nX8l        UR                  SU5        Ub  UR                  SU5        X�R                  S5      U4$ )zRReturn an `a` [`Element`][xml.etree.ElementTree.Element] or `(None, None, None)`. r   ©NNNÚaÚhrefÚtitle)ÚgetTextr¹   ÚgetLinkrÎ   rÏ   rœ   Úsetr¸   )	rv   r   r¬   rœ   r>  ÚhandledrW  rX  rÐ   s	            rO   r€   ÚLinkInlineProcessor.handleMatch·  s„   € à#Ÿ|™|¨D·%±%¸³(Ó;Ñˆ�WæØ#à&*§l¡l°4Ó&?Ñ#ˆ�UÞØ#ä�]Š]˜3ÓˆØŒà
�‰ˆv�tÔàÑØ�F‰F�7˜EÔ"à—7‘7˜1“:˜uÐ$Ð$rQ   c           	     ó6  • SnSnSnU R                   R                  XS9nU(       aw  UR                  S5      (       aa  UR                  S5      SS R                  5       nUR                  S5      (       a  UR                  S5      SS nUR	                  S5      nS	nGO•U(       Ga�  SnSnUR	                  5       n	U	nSn
SnSnSnSnSnSnSnSn[        U[        U5      5       GH/  nUU   nUS
:X  a  U(       d  US-  nOŸUS:”  a  US-  nO“US:X  a?  US:w  a  UU:X  d  US:w  a	  UU:X  a  SnOrU(       d  US-  nOeUS:”  a  US-  nUS:X  a  US-   n
ONUS;   aH  U(       d  S	nUnSnUS-   nUnO3UU:w  a  U(       d  US-   nUnOUU:X  a  US-   nOU(       a  UU:X  a  US-   nUS-  nUS:X  a^  US:¼  a$  UU:X  a  XUS-
   nSR                  XUS-
   5      nO2US:¼  a%  UU:X  a  XUS-
   nSR                  UUUS-
   5      nOXUS-
   n  OUS:w  d  GM-  UnGM2     US:w  a  US:X  a  XU
S-
   nU
nSnUS:H  nUbB  U R                  R                  S[        U R                  UR                  5       5      5      5      nU R                  U5      R                  5       nX4X%4$ )z?Parse data between `()` of `[Text]()` allowing recursive `()`. rŠ   NF©r;  r   rU   r²   r   TÚ(Ú))rT   rS   Ú )ÚRE_LINKr4  r‹   rð   r¹   Úrangerü   rŽ   ÚRE_TITLE_CLEANrš   rY   r�   )rv   r¬   r>  rW  rX  r\  r   Úbracket_countÚbacktrack_countÚstart_indexÚlast_bracketÚquoteÚstart_quoteÚ
exit_quoteÚignore_matchesÚ	alt_quoteÚstart_alt_quoteÚexit_alt_quoter9  r;  Úcs                        rO   rZ  ÚLinkInlineProcessor.getLinkÌ  s  € ð ˆØ ˆØˆà�L‰L×Ñ˜tÐÐ/ˆÞ�—‘˜—‘à—7‘7˜1“:˜a Ð#×)Ñ)Ó+ˆDØ�w‰w�q�z‰zØŸ™ ›
 1 RÐ(�Ø—E‘E˜!“HˆEØŠGßàˆMØˆOØŸ%™%›'ˆKØˆEØˆLð !%ˆEØˆKØˆJØ"ˆNð ˆIØ ˆOØˆNð ˆDä˜U¤C¨£I×.�Ø˜‘I�Ø˜“8ö *Ø%¨Ñ*™Ø(¨1Ó,Ø'¨1Ñ,˜øØ˜#“Xð $ rÓ)¨e°t«mÀÐSUÓAUÐZcÐgkÓZkØ()™Þ+Ø%¨Ñ*™Ø(¨1Ó,Ø'¨1Ñ,˜à*¨aÓ/Ø+0°1©9˜Løà˜*“_æ ð *.˜Ø*7˜Ø()˜Ø&+¨a¡i˜Ø !™à˜e›®IØ*/°!©)˜Ø$%™	à˜e›Ø%*¨Q¡Y™
æ" q¨I£~Ø).°©˜à˜‘
�ð ! AÓ%à! Q“¨5°D«=Ø#°¸a±Ð@˜Ø "§¡¨¸Àa¹Ð(HÓ I™Ø'¨1Ó,°¸dÓ1BØ#°À!Ñ0CÐD˜Ø "§¡¨¨_¸^ÈaÑ=OÐ(PÓ Q™à#°¸±	Ð:˜Ùà˜–8Ø“Dñw /ðB  Ó! o¸Ó&:Ø¨°qÑ(8Ð9�Ø$�Ø !�à# qÑ(ˆGàÑØ×'Ñ'×+Ñ+¨C´¸¿¹ÀuÇ{Á{Ã}Ó9UÓ1VÓWˆEà�}‰}˜TÓ"×(Ñ(Ó*ˆà˜EÐ*Ð*rQ   c                óà   • Sn/ n[        U[        U5      5       H<  nX   nUS:X  a  US-  nOUS:X  a  US-  nUS-  nUS:X  a    OUR                  U5        M>     SR                  U5      X#S:H  4$ )zcParse the content between `[]` of the start of an image or link
resolving nested square brackets.

r   Ú]Ú[r   rŠ   )rd  rü   r,  rŽ   )rv   r¬   r>  rf  rœ   r;  rq  s          rO   rY  ÚLinkInlineProcessor.getText@  s…   € ð
 ˆØˆÜ˜¤ D£	Ö*ˆCØ‘	ˆAØ�C‹xØ Ñ"‘Ø�c“Ø Ñ"�Ø�Q‰JˆEØ Ó!ÙØ�K‰K˜ŽNñ +ð �w‰w�t‹}˜e°aÑ%7Ð7Ð7rQ   rb   NrG  )r¬   r_   r>  r  r¡   z!tuple[str, str | None, int, bool])r¬   r_   r>  r  r¡   útuple[str, int, bool])rc   rd   re   rf   rg   rq   rr   rs   rt   rc  re  r€   rZ  rY  ri   rb   rQ   rO   r7   r7   ²  sH   † Ù7Ø�jŠjÐRÐTV×T]ÑT]Ð`b×`jÑ`jÑTjÓk€GØ—Z’Z Ó&€Nô%ô*r+÷h8rQ   r7   c                  ó"   • \ rS rSrSrSS jrSrg)r9   iT  z-Return a `img` element from the given match. c                ór  • U R                  X!R                  S5      5      u  p4nU(       d  gU R                  X$5      u  pgpEU(       d  g[        R                  " S5      nUR                  SU5        Ub  UR                  SU5        UR                  SU R                  U5      5        X�R                  S5      U4$ )zTReturn an `img` [`Element`][xml.etree.ElementTree.Element] or `(None, None, None)`. r   rU  ÚimgÚsrcrX  Úalt)rY  r¹   rZ  rÎ   rÏ   r[  r�   r¸   )	rv   r   r¬   rœ   r>  r\  r{  rX  rÐ   s	            rO   r€   Ú ImageInlineProcessor.handleMatchW  s–   € à#Ÿ|™|¨D·%±%¸³(Ó;Ñˆ�WÞØ#à%)§\¡\°$Ó%>Ñ"ˆ�EÞØ#ä�]Š]˜5Ó!ˆà
�‰ˆu�cÔàÑØ�F‰F�7˜EÔ"à
�‰ˆu�d—m‘m DÓ)Ô*Ø—7‘7˜1“:˜uÐ$Ð$rQ   rb   NrG  rµ   rb   rQ   rO   r9   r9   T  s
   † Ù8÷%rQ   r9   c                  óÄ   • \ rS rSrSr\R                  " S\R                  5      r\R                  " S\R                  \R                  -  5      rS
S jrSS jrSS jrSrg	)r5   il  z5Match to a stored reference and return link element. z\s+z\s?\[([^\]]*)\]c                ó¢  • U R                  X!R                  S5      5      u  p4nU(       d  gU R                  X$U5      u  pgnU(       d  gU R                  R	                  SU5      nX`R
                  R                  ;  a  SUR                  S5      U4$ U R
                  R                  U   u  p‰U R                  X‰U5      UR                  S5      U4$ )zj
Return [`Element`][xml.etree.ElementTree.Element] returned by `makeTag` method or `(None, None, None)`.

r   rU  rb  N)	rY  r¹   ÚevalIdÚNEWLINE_CLEANUP_RErš   rL   Ú
referencesr¸   ÚmakeTag)
rv   r   r¬   rœ   r>  r\  r�   r¹   rW  rX  s
             rO   r€   Ú$ReferenceInlineProcessor.handleMatchr  sµ   € ð
  $Ÿ|™|¨D·%±%¸³(Ó;Ñˆ�WÞØ#àŸ;™; t°DÓ9Ñˆ�ÞØ#ð ×$Ñ$×(Ñ(¨¨bÓ1ˆØ—W‘W×'Ñ'Ó'Ø˜Ÿ™ › SÐ(Ð(à—g‘g×(Ñ(¨Ñ,‰ˆà�|‰|˜D¨Ó.°·±¸³
¸CÐ?Ð?rQ   c                óâ   • U R                   R                  XS9nU(       d  SUS4$ UR                  S5      R                  5       nUR	                  S5      nU(       d  UR                  5       nXVS4$ )zD
Evaluate the id portion of `[ref][id]`.

If `[ref][]` use `[ref]`.
r_  NFr   r   T)rc  r4  r‹   Úlowerr¹   )rv   r¬   r>  rœ   r   r�   r¹   s          rO   r€  ÚReferenceInlineProcessor.evalIdˆ  sf   € ð �L‰L×Ñ˜tÐÐ/ˆÞØ˜ Ð%Ð%à—‘˜“×!Ñ!Ó#ˆBØ—%‘%˜“(ˆCÞØ—Z‘Z“\�Ø˜ˆ}ÐrQ   c                ó”   • [         R                  " S5      nUR                  SU5        U(       a  UR                  SU5        X4l        U$ )z:Return an `a` [`Element`][xml.etree.ElementTree.Element]. rV  rW  rX  )rÎ   rÏ   r[  rœ   ©rv   rW  rX  rœ   rÐ   s        rO   rƒ  Ú ReferenceInlineProcessor.makeTag˜  s9   € ä�]Š]˜3Óˆà
�‰ˆv�tÔÞØ�F‰F�7˜EÔ"àŒØˆ	rQ   rb   NrG  )r¬   r_   r>  r  rœ   r_   r¡   ztuple[str | None, int, bool]©rW  r_   rX  r_   rœ   r_   r¡   rÕ   )rc   rd   re   rf   rg   rq   rr   Ú	MULTILINEr�  rs   rt   rc  r€   r€  rƒ  ri   rb   rQ   rO   r5   r5   l  sH   † Ù@ØŸš F¨B¯L©LÓ9Ðà�jŠjÐ+¨R¯Y©Y¸¿¹Ñ-CÓD€Gô@ô,÷ 	rQ   r5   c                  ó"   • \ rS rSrSrSS jrSrg)r=   i¤  z%Short form of reference: `[google]`. c                ó(   • UR                  5       US4$ ©zEvaluate the id of `[ref]`.  T©r†  ©rv   r¬   r>  rœ   s       rO   r€  Ú$ShortReferenceInlineProcessor.evalId¦  ó   € ð �z‰z‹|˜U DÐ(Ð(rQ   rb   N©r¬   r_   r>  r  rœ   r_   r¡   rw  ©rc   rd   re   rf   rg   r€  ri   rb   rQ   rO   r=   r=   ¤  s
   † Ù/÷)rQ   r=   c                  ó"   • \ rS rSrSrSS jrSrg)r;   i¬  z6Match to a stored reference and return `img` element. c                óÊ   • [         R                  " S5      nUR                  SU5        U(       a  UR                  SU5        UR                  SU R                  U5      5        U$ )z<Return an `img` [`Element`][xml.etree.ElementTree.Element]. rz  r{  rX  r|  )rÎ   rÏ   r[  r�   r‰  s        rO   rƒ  Ú%ImageReferenceInlineProcessor.makeTag®  sK   € ä�]Š]˜5Ó!ˆØ
�‰ˆu�dÔÞØ�F‰F�7˜EÔ"Ø
�‰ˆu�d—m‘m DÓ)Ô*Øˆ	rQ   rb   Nr‹  )rc   rd   re   rf   rg   rƒ  ri   rb   rQ   rO   r;   r;   ¬  s
   † ÙA÷rQ   r;   c                  ó"   • \ rS rSrSrSS jrSrg)r>   i¸  z)Short form of image reference: `![ref]`. c                ó(   • UR                  5       US4$ r�  r�  r‘  s       rO   r€  Ú)ShortImageReferenceInlineProcessor.evalIdº  r“  rQ   rb   Nr”  r•  rb   rQ   rO   r>   r>   ¸  s
   † Ù4÷)rQ   r>   c                  ó"   • \ rS rSrSrSS jrSrg)r?   iÀ  zCReturn a link Element given an auto-link (`<http://example/com>`). c                ó&  • [         R                  " S5      nUR                  SU R                  UR	                  S5      5      5        [
        R                  " UR	                  S5      5      Ul        X1R                  S5      UR                  S5      4$ )zHReturn an `a` [`Element`][xml.etree.ElementTree.Element] of `group(1)`. rV  rW  r   r   )
rÎ   rÏ   r[  r�   r‹   r   rî   rœ   r¸   r¹   rÛ   s       rO   r€   Ú#AutolinkInlineProcessor.handleMatchÂ  sd   € ä�]Š]˜3ÓˆØ
�‰ˆv�t—}‘} Q§W¡W¨Q£ZÓ0Ô1Ü×#Ò# A§G¡G¨A£JÓ/ˆŒØ—7‘7˜1“:˜qŸu™u Q›xÐ'Ð'rQ   rb   NrÝ   rµ   rb   rQ   rO   r?   r?   À  s
   † ÙN÷(rQ   r?   c                  ó"   • \ rS rSrSrSS jrSrg)rA   iÊ  zO
Return a `mailto` link Element given an auto-mail link (`<foo@example.com>`).
c           
     óX  • [         R                  " S5      nU R                  UR                  S5      5      nUR	                  S5      (       a  U[        S5      S nS
S jnU Vs/ s H  oe" [        U5      5      PM     nn[        R                  " SR                  U5      5      Ul
        SU-   nSR                  U Vs/ s H"  n[        R                  S[        U5      -  -   PM$     sn5      nUR                  SU5        X1R                  S	5      UR                  S	5      4$ s  snf s  snf )z`Return an [`Element`][xml.etree.ElementTree.Element] containing a `mailto` link  of `group(1)`. rV  r   zmailto:Nc                ó¸   • [         R                  R                  U 5      nU(       a   SR                  [        R
                  U5      $ S[        R
                  U 4-  $ )z=Return entity definition by code, or the code if not defined.z{}{};z%s#%d;)r
   Úcodepoint2namerŒ   rÀ   r   ÚAMP_SUBSTITUTE)rê   r&   s     rO   r¢  Ú;AutomailInlineProcessor.handleMatch.<locals>.codepoint2nameÕ  sH   € ä×,Ñ,×0Ñ0°Ó6ˆFÞØ—~‘~¤d×&9Ñ&9¸6ÓBÐBà¤4×#6Ñ#6¸Ð"=Ñ=Ð=rQ   rŠ   z#%d;rW  r   )rê   r  r¡   r_   )rÎ   rÏ   r�   r‹   rV   rü   rÂ   r   rî   rŽ   rœ   r£  r[  r¸   r¹   )	rv   r   r¬   rÐ   Úemailr¢  ÚletterÚlettersÚmailtos	            rO   r€   Ú#AutomailInlineProcessor.handleMatchÎ  s  € ä�]Š]˜3ÓˆØ—‘˜aŸg™g a›jÓ)ˆØ×Ñ˜I×&Ñ&Øœ#˜i›.˜/Ð*ˆEô	>ñ >CÓCºU°6�>¤# f£+Ö.¹UˆÐCÜ×#Ò# B§G¡G¨GÓ$4Ó5ˆŒà˜UÑ"ˆØ—‘Ù4:ó<Ú4:¨&ô ×-Ñ-°Ü˜f›+ñ1&ô &Ù4:ñ<ó =ˆà
�‰ˆv�vÔØ—7‘7˜1“:˜qŸu™u Q›xÐ'Ð'ùò Dùò<s   Á$D"Â>)D'rb   NrÝ   rµ   rb   rQ   rO   rA   rA   Ê  s   † ñ÷(rQ   rA   )rL   r   rM   r   r¡   zutil.Registry[InlineProcessor])rX   r_   r¡   r_   )Crg   Ú
__future__r   rŠ   r   Útypingr   r   r   r	   rq   Úxml.etree.ElementTreerÎ   ÚElementTreer$   r
   Úmarkdownr   rP   ÚNOIMGr2   r4   rL  rK  rQ  rR  rP  rH  rN  rI  rO  rJ  r8   r:   r6   r<   rI   r@   rB   rF   rG   rD   rY   r[   rk   r¦   r°   rH   r3   rÇ   r×   rß   rC   r1   rô   r  rE   rJ   rK   r7   r9   r5   r=   r;   r>   r?   rA   rb   rQ   rO   Ú<module>r°     s5  ðñ(õ* #å ß =Ó =Û 	ß %Ð %Ý æÝ!ô*ð` 	€Ø \àL€Ø Mà€	Ø =à€Ø 7à€	Ø 5à:€Ø bà9Ð Ø càOÐ Ø Bà,€Ø Sà,€Ø Và,€Ø ?à,€Ø Bà9€Ø ?à
�%‰-€Ø `à€Ø Sà€Ø 5à"Ð Ø :à8€Ø 'à<€Ø =à&€Ø ;ð
ð ð %à<€	Ø Và€Ø (ôô�:ô ÷S?ñ S?ôl-�gô -ô`˜ô ô0 ô 0ô.˜Oô .ô&�wô ô:(˜ô (ô:'Ð+ô 'ô=Ð#;ô =ôY˜oô Yô2Ð'ô ô*)Ð7ô )ô*%'˜/ô %'ôPC˜ô CôL
PÐ+ô 
Pô_8˜/ô _8ôD%Ð.ô %ô05Ð2ô 5ôp)Ð$<ô )ô	Ð$<ô 	ô)Ð)Fô )ô(˜oô (ô(˜oõ (rQ   