%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/markdown/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/markdown/__pycache__/preprocessors.cpython-312.pyc

�

���e����dZddlmZddlmZmZddlmZddlm	Z	ddl
Z
erddlmZdd	�Z
Gd
�dej�ZGd�d
e�ZGd�de�Zy)z�
Preprocessors work on source text before it is broken down into its individual parts.
This is an excellent place to clean up bad characters or to extract portions for later
processing that the parser may otherwise choke on.
�)�annotations)�
TYPE_CHECKING�Any�)�util)�
HTMLExtractorN)�Markdownc��tj�}|jt|�dd�|jt	|�dd�|S)zE Build and return the default set of preprocessors used by Markdown. �normalize_whitespace��
html_block�)r�Registry�register�NormalizeWhitespace�HtmlBlockPreprocessor)�md�kwargs�
preprocessorss   �8/usr/lib/python3/dist-packages/markdown/preprocessors.py�build_preprocessorsr%sD���M�M�O�M����.�r�2�4J�B�O����0��4�l�B�G���c��eZdZdZdd�Zy)�Preprocessora?
    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 `Preprocessor`.

    c��y)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.

        N�)�self�liness  r�runzPreprocessor.run8s��	
rN�r�	list[str]�returnr!��__name__�
__module__�__qualname__�__doc__rrrrrr-s��	�
rrc��eZdZdZdd�Zy)rz. Normalize whitespace for consistent parsing. c��dj|�}|jtjd�jtjd�}|jdd�jdd�dz}|j|jj�}tjdd|�}|jd�S)N�
�z
�
z

z(?<=\n) +\n)�join�replacer�STX�ETX�
expandtabsr�
tab_length�re�sub�split)rr�sources   rrzNormalizeWhitespace.runEs������5�!��������"�-�5�5�d�h�h��C�������-�5�5�d�D�A�F�J���"�"�4�7�7�#5�#5�6�������f�5���|�|�D�!�!rNr r#rrrrrBs
��8�"rrc��eZdZdZdd�Zy)rz�
    Remove html blocks from the text and store them for later retrieval.

    The raw HTML is stored in the [`htmlStash`][markdown.util.HtmlStash] of the
    [`Markdown`][markdown.Markdown] instance.
    c���dj|�}t|j�}|j|�|j	�dj|j
�j
d�S)Nr*r+)r-rr�feed�close�cleandocr5)rrr6�parsers    rrzHtmlBlockPreprocessor.runVsQ�����5�!���t�w�w�'�����F�������w�w�v���'�-�-�d�3�3rNr r#rrrrrNs���4rr)rr	rrr"zutil.Registry[Preprocessor])r'�
__future__r�typingrrr+r�
htmlparserrr3�markdownr	r�	Processorrrrrrr�<module>rBsN��(�#�%��%�	��!��
�4�>�>�
�*	"�,�	"�
4�L�
4r

Zerion Mini Shell 1.0