
    -Be
                         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
y)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                         }|j                  t        |       dd       |j                  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.12/site-packages/markdown/preprocessors.pybuild_preprocessorsr   !   sD    MMOM.r24JBO04lBG    c                       e Zd ZdZd Zy)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                      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   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y)r   z. Normalize whitespace for consistent parsing. c                    dj                  |      }|j                  t        j                  d      j                  t        j                  d      }|j                  dd      j                  dd      dz   }|j                  | j                  j                        }t        j                  dd|      }|j                  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5dhhC-55dDAFJ""477#5#56f5||D!!r   Nr   r   r   r   r   r   >   s
    8"r   r   c                       e Zd ZdZd Zy)r   zDRemove html blocks from the text and store them for later retrieval.c                     dj                  |      }t        | j                        }|j                  |       |j	                          dj                  |j
                        j                  d      S )Nr#   r$   )r&   r   r   feedclosecleandocr.   )r   r   r/   parsers       r   r   zHtmlBlockPreprocessor.runM   sQ    5!tww'Fwwv'--d33r   Nr   r   r   r   r   r   J   s
    N4r   r   )r    r$   r   
htmlparserr   r,   r   	Processorr   r   r   r   r   r   <module>r8      sB   6  % 	4>> *	", 	"4L 4r   