o
     h7                     @  s   d dl mZ d dlmZmZmZ d dlmZ d dlmZ d dl	m
Z
mZmZmZ e
r0d dlmZ eeef Z	 G dd deZG d	d
 d
eZG dd deZdddZdS )    )annotations)CallableIterableMutableMapping)r   )Path)TYPE_CHECKINGAny	TypedDictcast)NotRequiredc                   @  st   e Zd ZU dZded< 	 ded< 	 ded< 	 ded< 	 ded	< 	 ded
< 	 ded< 	 ded< 	 ded< 	 ded< dS )OptionsTypezOptions for parsing.int
maxNestingboolhtmllinkifytypographerstrquotesxhtmlOutbreaks
langPrefix%Callable[[str, str, str], str] | None	highlightzNotRequired[bool]store_labelsN__name__
__module____qualname____doc____annotations__ r!   r!   S/var/www/html/pro-man-master/venv/lib/python3.10/site-packages/markdown_it/utils.pyr      s,   
 r   c                   @  s$   e Zd ZU dZded< 	 ded< dS )
PresetTypez%Preset configuration for markdown-it.r   optionsz3MutableMapping[str, MutableMapping[str, list[str]]]
componentsNr   r!   r!   r!   r"   r#   .   s   
 r#   c                   @  sn  e Zd ZdZd:ddZd;ddZd<ddZd=ddZd>ddZd?ddZ	d@ddZ
d@ddZed?ddZejdAddZedBd d!ZejdCd"d!ZedBd#d$ZejdCd%d$ZedBd&d'ZejdCd(d'Zed@d)d*ZejdDd+d*ZedBd,d-ZejdCd.d-ZedBd/d0ZejdCd1d0Zed@d2d3ZejdDd4d3ZedEd6d7ZejdFd8d7Zd9S )GOptionsDictzMA dictionary, with attribute access to core markdownit configuration options.r$   r   returnNonec                 C  s   t tt|| _d S N)r
   r   dict_options)selfr$   r!   r!   r"   __init__=   s   zOptionsDict.__init__keyr   r   c                 C  s
   | j | S r)   r+   r,   r.   r!   r!   r"   __getitem__@      
zOptionsDict.__getitem__valuec                 C  s   || j |< d S r)   r/   )r,   r.   r3   r!   r!   r"   __setitem__C   s   zOptionsDict.__setitem__c                 C  s   | j |= d S r)   r/   r0   r!   r!   r"   __delitem__F   s   zOptionsDict.__delitem__Iterable[str]c                 C  
   t | jS r)   )iterr+   r,   r!   r!   r"   __iter__I   r2   zOptionsDict.__iter__r   c                 C  r7   r)   )lenr+   r9   r!   r!   r"   __len__L   r2   zOptionsDict.__len__c                 C  r7   r)   )reprr+   r9   r!   r!   r"   __repr__O   r2   zOptionsDict.__repr__c                 C  r7   r)   )r   r+   r9   r!   r!   r"   __str__R   r2   zOptionsDict.__str__c                 C  
   | j d S )z%Internal protection, recursion limit.r   r/   r9   r!   r!   r"   r   U      
zOptionsDict.maxNestingc                 C     || j d< d S )Nr   r/   r,   r3   r!   r!   r"   r   Z      r   c                 C  r@   )zEnable HTML tags in source.r   r/   r9   r!   r!   r"   r   ^   rA   zOptionsDict.htmlc                 C  rB   )Nr   r/   rC   r!   r!   r"   r   c   rD   c                 C  r@   )z1Enable autoconversion of URL-like texts to links.r   r/   r9   r!   r!   r"   r   g   rA   zOptionsDict.linkifyc                 C  rB   )Nr   r/   rC   r!   r!   r"   r   l   rD   c                 C  r@   )z$Enable smartquotes and replacements.r   r/   r9   r!   r!   r"   r   p   rA   zOptionsDict.typographerc                 C  rB   )Nr   r/   rC   r!   r!   r"   r   u   rD   c                 C  r@   )zQuote characters.r   r/   r9   r!   r!   r"   r   y   rA   zOptionsDict.quotesc                 C  rB   )Nr   r/   rC   r!   r!   r"   r   ~   rD   c                 C  r@   )z&Use '/' to close single tags (<br />).r   r/   r9   r!   r!   r"   r      rA   zOptionsDict.xhtmlOutc                 C  rB   )Nr   r/   rC   r!   r!   r"   r      rD   c                 C  r@   )z)Convert newlines in paragraphs into <br>.r   r/   r9   r!   r!   r"   r      rA   zOptionsDict.breaksc                 C  rB   )Nr   r/   rC   r!   r!   r"   r      rD   c                 C  r@   )z&CSS language prefix for fenced blocks.r   r/   r9   r!   r!   r"   r      rA   zOptionsDict.langPrefixc                 C  rB   )Nr   r/   rC   r!   r!   r"   r      rD   r   c                 C  r@   )zEHighlighter function: (content, langName, langAttrs) -> escaped HTML.r   r/   r9   r!   r!   r"   r      rA   zOptionsDict.highlightc                 C  rB   )Nr   r/   rC   r!   r!   r"   r      rD   N)r$   r   r'   r(   )r.   r   r'   r   )r.   r   r3   r   r'   r(   )r.   r   r'   r(   )r'   r6   )r'   r   )r'   r   )r3   r   r'   r(   )r'   r   )r3   r   r'   r(   )r3   r   r'   r(   )r'   r   )r3   r   r'   r(   )r   r   r   r   r-   r1   r4   r5   r:   r<   r>   r?   propertyr   setterr   r   r   r   r   r   r   r   r!   r!   r!   r"   r&   7   s\    







r&   path
str | Pathr'   list[list[Any]]c                 C  s   t | jdd}g }d}d}|jdd}tt|D ]M}||  dkrg|dkr8||||d   g d}n-|dkrO|d d	||d |  d
}n|d
kre|d d	||d |  d}|}q|S )Nzutf-8)encodingr   T)keepends.       )	r   	read_text
splitlinesranger;   rstripappendstripjoin)rG   texttestssectionlast_poslinesir!   r!   r"   read_fixture_file   s&     r^   N)rG   rH   r'   rI   )
__future__r   collections.abcr   r   r   MutableMappingABCpathlibr   typingr   r   r	   r
   typing_extensionsr   r   EnvTyper   r#   r&   r^   r!   r!   r!   r"   <module>   s    	p