
    dd                    V    d dl mZ d dlmZ d dlmZ  G d de          Zdd
ZddZ	dS )    )annotations)Callable)Pathc                     e Zd ZdZedd            Zej        dd            Zedd            Zej        dd	            Zedd
            Zej        dd            Zedd            Z	e	j        dd            Z	edd            Z
e
j        d d            Z
edd            Zej        dd            Zedd            Zej        dd            Zedd            Zej        d d            Zed!d            Zej        d"d            ZdS )#OptionsDictzMA dictionary, with attribute access to core markdownit configuration options.returnintc                    | d         S )z%Internal protection, recursion limit.
maxNesting selfs    1lib/python3.11/site-packages/markdown_it/utils.pyr   zOptionsDict.maxNesting
        L!!    valuec                    || d<   d S )Nr   r   r   r   s     r   r   zOptionsDict.maxNesting       "\r   boolc                    | d         S )zEnable HTML tags in source.htmlr   r   s    r   r   zOptionsDict.html   s     F|r   c                    || d<   d S )Nr   r   r   s     r   r   zOptionsDict.html   s    Vr   c                    | d         S )z1Enable autoconversion of URL-like texts to links.linkifyr   r   s    r   r   zOptionsDict.linkify   s     Ir   c                    || d<   d S )Nr   r   r   s     r   r   zOptionsDict.linkify!   s    Yr   c                    | d         S )z$Enable smartquotes and replacements.typographerr   r   s    r   r   zOptionsDict.typographer%   s     M""r   c                    || d<   d S )Nr   r   r   s     r   r   zOptionsDict.typographer*   s    #]r   strc                    | d         S )zQuote characters.quotesr   r   s    r   r"   zOptionsDict.quotes.        H~r   c                    || d<   d S )Nr"   r   r   s     r   r"   zOptionsDict.quotes3       Xr   c                    | d         S )z&Use '/' to close single tags (<br />).xhtmlOutr   r   s    r   r'   zOptionsDict.xhtmlOut7   s     Jr   c                    || d<   d S )Nr'   r   r   s     r   r'   zOptionsDict.xhtmlOut<   s     Zr   c                    | d         S )z)Convert newlines in paragraphs into <br>.breaksr   r   s    r   r*   zOptionsDict.breaks@   r#   r   c                    || d<   d S )Nr*   r   r   s     r   r*   zOptionsDict.breaksE   r%   r   c                    | d         S )z&CSS language prefix for fenced blocks.
langPrefixr   r   s    r   r-   zOptionsDict.langPrefixI   r   r   c                    || d<   d S )Nr-   r   r   s     r   r-   zOptionsDict.langPrefixN   r   r   %Callable[[str, str, str], str] | Nonec                    | d         S )zEHighlighter function: (content, langName, langAttrs) -> escaped HTML.	highlightr   r   s    r   r1   zOptionsDict.highlightR   s     K  r   c                    || d<   d S )Nr1   r   r   s     r   r1   zOptionsDict.highlightW   s    ![r   N)r   r	   )r   r	   )r   r   )r   r   )r   r    )r   r    )r   r/   )r   r/   )__name__
__module____qualname____doc__propertyr   setterr   r   r   r"   r'   r*   r-   r1   r   r   r   r   r      sr       WW" " " X" # # # #    X 
[   [    X ^      ^  # # # X# $ $ $ $    X ]   ]       X  _! ! ! _!    X ]   ] " " " X" # # # # ! ! ! X! " " " " " "r   r   path
str | Pathr   
list[list]c                ~   t          |                               d          }g }d}d}|                    d          }t          t	          |                    D ]}||                                         dk    r|dk    r5|                    |||dz
                                           g           d}n|dk    r<|d                             d	                    ||dz   |                              d
}nA|d
k    r;|d                             d	                    ||dz   |                              d}|}|S )Nzutf-8)encodingr   T)keepends.       )	r   	read_text
splitlinesrangelenrstripappendstripjoin)r9   texttestssectionlast_poslinesis          r   read_fixture_filerR   \   s>   ::11DEGHOOTO**E3u::  8??##!||aq1u!3!3!5!56777Ab	  x!|a/?)@!A!ABBBAb	  x!|a/?)@!A!ABBBHLr   stringr    suffixc                d    |r-|                      |          r| dt          |                    S | S )zRemove a suffix from a string.

    Replace this with str.removesuffix() from stdlib when minimum Python
    version is 3.9.
    N)endswithrG   )rS   rT   s     r   _removesuffixrW   r   s;      &&//&)) &nVn%%Mr   N)r9   r:   r   r;   )rS   r    rT   r    r   r    )

__future__r   collections.abcr   pathlibr   dictr   rR   rW   r   r   r   <module>r\      s    " " " " " " $ $ $ $ $ $      R" R" R" R" R"$ R" R" R"j   ,     r   