
    c
                         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
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                     t          j                    }|                    t          |           dd           |                    t	          |           dd           |S )z: Build the default set of preprocessors used by Markdown. normalize_whitespace   
html_block   )r   RegistryregisterNormalizeWhitespaceHtmlBlockPreprocessor)mdkwargspreprocessorss      6lib/python3.11/site-packages/markdown/preprocessors.pybuild_preprocessorsr   !   sV    MOOM.r224JBOOO044lBGGG    c                       e Zd ZdZ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                     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.

        N )selfliness     r   runzPreprocessor.run4   s	     	r   N__name__
__module____qualname____doc__r   r   r   r   r   r   )   s-        	 	    r   r   c                       e Zd ZdZd ZdS )r   z. Normalize whitespace for consistent parsing. c                    d                     |          }|                    t          j        d                              t          j        d          }|                    dd                              dd          dz   }|                    | j        j                  }t          j	        dd|          }|
                    d          S )N
 z
z

z(?<=\n) +\n)joinreplacer   STXETX
expandtabsr   
tab_lengthresubsplit)r   r   sources      r   r   zNormalizeWhitespace.runA   s    5!!"--55dhCC--55dDAAFJ""47#566f55||D!!!r   Nr   r   r   r   r   r   >   s)        88" " " " "r   r   c                       e Zd ZdZd ZdS )r   zDRemove html blocks from the text and store them for later retrieval.c                     d                     |          }t          | j                  }|                    |           |                                 d                     |j                                      d          S )Nr#   r$   )r&   r   r   feedclosecleandocr.   )r   r   r/   parsers       r   r   zHtmlBlockPreprocessor.runM   sc    5!!tw''Fwwv''--d333r   Nr   r   r   r   r   r   J   s)        NN4 4 4 4 4r   r   )r    r$   r   
htmlparserr   r,   r   	Processorr   r   r   r   r   r   <module>r8      s    6       % % % % % % 				      4>   *	" 	" 	" 	" 	", 	" 	" 	"4 4 4 4 4L 4 4 4 4 4r   