U
    muf/  ã                   @   sP   d dl Z d dlZe  d¡Zde  ej¡ d ZdgZdd„ Zdd	„ Z	d
d„ Z
dS )é    Nz *\n\s*z
(?:^[^\s\dz][^\n]*\n)+Úspeedupc                 C   s*   |  d¡}t d|¡}|  ||¡ | ¡ S )Nr   Ú
)ÚgroupÚHARD_LINEBREAK_REÚsubZprocess_textÚend)ÚinlineÚmÚstateÚtext© r   ú;/tmp/pip-unpacked-wheel-8p1ovdot/mistune/plugins/speedup.pyÚ
parse_text   s    
r   c                 C   s   |  d¡}| |¡ | ¡ S )Nr   )r   Zadd_paragraphr   )Úblockr	   r
   r   r   r   r   Úparse_paragraph   s    

r   c                 C   sj   | j  dtt¡ d}d| d }d| jjkr4|d7 }| jjrF|d7 }n|d7 }|d	7 }| j d
|t¡ dS )z8Increase the speed of parsing paragraph and inline text.Z	paragraphz\\><!\[_*`~\^\$=z[\s\S]+?(?=[z]|Zurl_linkzhttps?:|z *\n|z {2,}\n|z$)r   N)r   ÚregisterÚ	PARAGRAPHr   r   ÚrulesZ	hard_wrapr   )ZmdZpuncZtext_patternr   r   r   r      s    
)ÚreÚstringÚcompiler   ÚescapeÚpunctuationr   Ú__all__r   r   r   r   r   r   r   Ú<module>   s   
þ