§
    Ó¼Ñbà  ã                   óÖ   — d Z ddlmZ ddlmZ ddlZd„ Z G d„ dej        ¦  «        Z G d	„ d
e¦  «        Z	 G d„ de¦  «        Z
 ej        d¦  «         G d„ de¦  «        ¦   «         ZdS )aà  
Python Markdown

A Python implementation of John Gruber's Markdown.

Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/

Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org).
Currently maintained by Waylan Limberg (https://github.com/waylan),
Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser).

Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later)
Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
Copyright 2004 Manfred Stienstra (the original version)

License: BSD (see LICENSE.md for details).

POST-PROCESSORS
=============================================================================

Markdown also allows post-processors, which are similar to preprocessors in
that they need to implement a "run" method. However, they are run after core
processing.

é    )ÚOrderedDicté   )ÚutilNc                 óº   — t          j        ¦   «         }|                     t          | ¦  «        dd¦  «         |                     t	          ¦   «         dd¦  «         |S )z0 Build the default postprocessors for Markdown. Úraw_htmlé   Úamp_substituteé   )r   ÚRegistryÚregisterÚRawHtmlPostprocessorÚAndSubstitutePostprocessor)ÚmdÚkwargsÚpostprocessorss      ú9/usr/lib/python3/dist-packages/markdown/postprocessors.pyÚbuild_postprocessorsr   #   sT   € å”]‘_”_€NØ×ÒÕ0°Ñ4Ô4°jÀ"ÑEÔEÐEØ×ÒÕ6Ñ8Ô8Ð:JÈBÑOÔOÐOØÐó    c                   ó   — e Zd ZdZd„ ZdS )ÚPostprocessora  
    Postprocessors are run after the ElementTree it converted back into text.

    Each Postprocessor implements a "run" method that takes a pointer to a
    text string, modifies it as necessary and returns a text string.

    Postprocessors must extend markdown.Postprocessor.

    c                 ó   — dS )z¿
        Subclasses of Postprocessor should implement a `run` method, which
        takes the html document as a single text string and returns a
        (possibly modified) string.

        N© ©ÚselfÚtexts     r   ÚrunzPostprocessor.run6   s	   € ð 	ˆr   N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   +   s-   € € € € € ðð ðð ð ð ð r   r   c                   óD   — e Zd ZdZ ej        d¦  «        Zd„ Zd„ Zd„ Z	dS )r   z# Restore raw html to the document. z^\<\/?([^ >]+)c                 óZ  ‡— t          ¦   «         Št          | j        j        j        ¦  «        D ]˜}|                      | j        j        j        |         ¦  «        }|                      |¦  «        r5|‰d                     | j        j         	                    |¦  «        ¦  «        <   |‰| j        j         	                    |¦  «        <   Œ™ˆfd„}‰r@t          j        dz  }t          j        d|› d|› �¦  «        }|                     ||¦  «        }n|S ||k    r|S |                      |¦  «        S )z+ Iterate over html stash and restore html. z	<p>{}</p>c                 óŠ   •— |                       d¦  «        }|‰vr"|dd…         ‰v rd‰|dd…                  › d�S |S ‰|         S )Nr   é   éüÿÿÿú<p>z</p>)Úgroup)ÚmÚkeyÚreplacementss     €r   Úsubstitute_matchz2RawHtmlPostprocessor.run.<locals>.substitute_matchO   s^   ø€ Ø—'’'˜!‘*”*ˆCà˜,Ð&Ð&Ø�q˜�t”9 Ð,Ð,Ø@ ,¨s°1°R°4¬yÔ"9Ð@Ð@Ð@Ð@à�Jà Ô$Ð$r   z([0-9]+)r'   z</p>|)r   Úranger   Ú	htmlStashÚhtml_counterÚstash_to_stringÚrawHtmlBlocksÚisblocklevelÚformatÚget_placeholderr   ÚHTML_PLACEHOLDERÚreÚcompileÚsubr   )	r   r   ÚiÚhtmlr,   Úbase_placeholderÚpatternÚprocessed_textr+   s	           @r   r   zRawHtmlPostprocessor.runE   sJ  ø€ å"‘}”}ˆÝ�t”wÔ(Ô5Ñ6Ô6ð 	Fð 	FˆAØ×'Ò'¨¬Ô(9Ô(GÈÔ(JÑKÔKˆDØ× Ò  Ñ&Ô&ð Bà=Að ˜[×/Ò/Ø”GÔ%×5Ò5°aÑ8Ô8ñ:ô :ñ ;àAEˆL˜œÔ*×:Ò:¸1Ñ=Ô=Ñ>Ð>ð		%ð 		%ð 		%ð 		%ð 		%ð ð 	Ý#Ô4°{ÑBÐÝ”jÐ!TÐ(8Ð!TÐ!TÐAQÐ!TÐ!TÑUÔUˆGØ$Ÿ[š[Ð)9¸4Ñ@Ô@ˆNˆNàˆKà˜TÒ!Ð!Ø!Ð!à—8’8˜NÑ+Ô+Ð+r   c                 óÖ   — | j                              |¦  «        }|rL|                     d¦  «        d         dv rdS | j                             |                     d¦  «        ¦  «        S dS )Nr   r   )ú!ú?ú@ú%TF)ÚBLOCK_LEVEL_REGEXÚmatchr(   r   Úis_block_level)r   r:   r)   s      r   r2   z!RawHtmlPostprocessor.isblocklevelf   sd   € ØÔ"×(Ò(¨Ñ.Ô.ˆØð 	6Ø�wŠw�q‰zŒz˜!Œ}Ð 4Ð4Ð4à�tØ”7×)Ò)¨!¯'ª'°!©*¬*Ñ5Ô5Ð5Øˆur   c                 ó    — t          |¦  «        S )z' Convert a stashed object to a string. )Ústrr   s     r   r0   z$RawHtmlPostprocessor.stash_to_stringo   s   € å�4‰yŒyÐr   N)
r   r   r    r!   r6   r7   rC   r   r2   r0   r   r   r   r   r   @   s[   € € € € € Ø-Ð-à"˜œ
Ð#4Ñ5Ô5Ðð,ð ,ð ,ðBð ð ðð ð ð ð r   r   c                   ó   — e Zd ZdZd„ ZdS )r   z Restore valid entities c                 óF   — |                      t          j        d¦  «        }|S )Nú&)Úreplacer   ÚAMP_SUBSTITUTEr   s     r   r   zAndSubstitutePostprocessor.runw   s   € Ø�|Š|�DÔ/°Ñ5Ô5ˆØˆr   Nr   r   r   r   r   r   t   s)   € € € € € Ø"Ð"ðð ð ð ð r   r   z]This class will be removed in the future; use 'treeprocessors.UnescapeTreeprocessor' instead.c                   óz   — e Zd ZdZ ej        d                     ej        ej	        ¦  «        ¦  «        Z
d„ Zd„ ZdS )ÚUnescapePostprocessorz Restore escaped chars z	{}(\d+){}c                 ó`   — t          t          |                     d¦  «        ¦  «        ¦  «        S )Nr   )ÚchrÚintr(   )r   r)   s     r   ÚunescapezUnescapePostprocessor.unescape…   s    € Ý•3�q—w’w˜q‘z”z‘?”?Ñ#Ô#Ð#r   c                 óB   — | j                              | j        |¦  «        S )N)ÚREr8   rR   r   s     r   r   zUnescapePostprocessor.runˆ   s   € ØŒw�{Š{˜4œ=¨$Ñ/Ô/Ð/r   N)r   r   r    r!   r6   r7   r3   r   ÚSTXÚETXrT   rR   r   r   r   r   rN   rN   |   s_   € € € € € ð
 "Ð!à	ˆŒ�L×'Ò'¨¬°$´(Ñ;Ô;Ñ	<Ô	<€Bð$ð $ð $ð0ð 0ð 0ð 0ð 0r   rN   )r!   Úcollectionsr   Ú r   r6   r   Ú	Processorr   r   r   Ú
deprecatedrN   r   r   r   ú<module>r[      s$  ððð ð: $Ð #Ð #Ð #Ð #Ð #Ø Ð Ð Ð Ð Ð Ø 	€	€	€	ðð ð ðð ð ð ð �D”Nñ ô ð ð*1ð 1ð 1ð 1ð 1˜=ñ 1ô 1ð 1ðhð ð ð ð  ñ ô ð ð €„ð:ñô ð	0ð 	0ð 	0ð 	0ð 	0˜Mñ 	0ô 	0ñ	ô ð	0ð 	0ð 	0r   