a
    Sic¶
  ã                   @   sb   d Z ddlmZ ddlmZ ddlZdd„ ZG dd	„ d	ejƒZG d
d„ deƒZ	G d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).

PRE-PROCESSORS
=============================================================================

Preprocessors work on source text before we start doing anything too
complicated.
é   )Úutil)ÚHTMLExtractoré    Nc                 K   s0   t  ¡ }| t| ƒdd¡ | t| ƒdd¡ |S )z: Build the default set of preprocessors used by Markdown. Znormalize_whitespaceé   Z
html_blocké   )r   ÚRegistryÚregisterÚNormalizeWhitespaceÚHtmlBlockPreprocessor)ÚmdÚkwargsÚpreprocessors© r   úR/var/www/html/django/DPS/env/lib/python3.9/site-packages/markdown/preprocessors.pyÚbuild_preprocessors!   s    r   c                   @   s   e Zd ZdZdd„ ZdS )ÚPreprocessoraF  
    Preprocessors are run after the text is broken into lines.

    Each preprocessor implements a "run" method that takes a pointer to a
    list of lines of the document, modifies it as necessary and returns
    either the same pointer or a pointer to a new list.

    Preprocessors must extend markdown.Preprocessor.

    c                 C   s   dS )zÕ
        Each subclass of Preprocessor should override the `run` method, which
        takes the document as a list of strings split by newlines and returns
        the (possibly modified) list of lines.

        Nr   )ÚselfÚlinesr   r   r   Úrun4   s    zPreprocessor.runN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   )   s   
r   c                   @   s   e Zd ZdZdd„ ZdS )r	   z. Normalize whitespace for consistent parsing. c                 C   s`   d  |¡}| tjd¡ tjd¡}| dd¡ dd¡d }| | jj¡}t 	dd|¡}| 
d¡S )NÚ
Ú z
úz

z(?<=\n) +\n)ÚjoinÚreplacer   ÚSTXÚETXÚ
expandtabsr   Ú
tab_lengthÚreÚsubÚsplit)r   r   Úsourcer   r   r   r   A   s    
zNormalizeWhitespace.runNr   r   r   r   r   r	   >   s   r	   c                   @   s   e Zd ZdZdd„ ZdS )r
   zDRemove html blocks from the text and store them for later retrieval.c                 C   s8   d  |¡}t| jƒ}| |¡ | ¡  d  |j¡ d¡S )Nr   r   )r   r   r   ÚfeedÚcloseÚcleandocr%   )r   r   r&   Úparserr   r   r   r   M   s
    


zHtmlBlockPreprocessor.runNr   r   r   r   r   r
   J   s   r
   )r   r   r   Z
htmlparserr   r#   r   Ú	Processorr   r	   r
   r   r   r   r   Ú<module>   s   