a
    ö£Be‹	  ã                   @   sÂ   U d Z 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 ddlmZmZmZmZ ddlmZ deeedœdd„Zed
g d¢d�Zeed< i Zdedœdd„Zg d¢ZdZdZdS )zÁ
    mistune
    ~~~~~~~

    A fast yet powerful Python Markdown parser with renderers and
    plugins, compatible with sane CommonMark rules.

    Documentation: https://mistune.lepture.com/
é   )ÚMarkdown)Ú
BlockStateÚInlineStateÚBaseRenderer)ÚBlockParser)ÚInlineParser)ÚHTMLRenderer)ÚescapeÚ
escape_urlÚsafe_entityÚunikey©Úimport_pluginTFÚhtmlN)r	   Ú	hard_wrapÚreturnc                 C   sN   |dkrd}n|dkr t | d�}t|d�}|dur@dd„ |D ƒ}t|||d�S )	a  Create a Markdown instance based on the given condition.

    :param escape: Boolean. If using html renderer, escape html.
    :param hard_wrap: Boolean. Break every new line into ``<br>``.
    :param renderer: renderer instance, default is HTMLRenderer.
    :param plugins: List of plugins.

    This method is used when you want to re-use a Markdown instance::

        markdown = create_markdown(
            escape=False,
            hard_wrap=True,
        )
        # re-use markdown function
        markdown('.... your text ...')
    ÚastNr   )r	   )r   c                 S   s   g | ]}t |ƒ‘qS © r   )Ú.0Únr   r   úS/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/mistune/__init__.pyÚ
<listcomp>-   ó    z#create_markdown.<locals>.<listcomp>)ÚrendererÚinlineÚplugins)r   r   r   )r	   r   r   r   r   r   r   r   Úcreate_markdown   s    

r   )ZstrikethroughZ	footnotesÚtableZspeedup)r	   r   )r   c                 C   sH   |dkrd }|||f}|t v r*t | | ƒS t|||d�}|t |< || ƒS )Nr   )r	   r   r   )Ú__cached_parsersr   )Útextr	   r   r   ÚkeyÚmdr   r   r   Úmarkdown:   s    
r"   )r   r   r   r   r   r   r   r	   r
   r   r   r   r   r"   z3.0.2zhttps://mistune.lepture.com/)TFr   N)Tr   N)Ú__doc__r"   r   Úcorer   r   r   Zblock_parserr   Zinline_parserr   Zrenderers.htmlr   Úutilr	   r
   r   r   r   r   Úboolr   r   Ú__annotations__r   ÚstrÚ__all__Ú__version__Z__homepage__r   r   r   r   Ú<module>   s"   
þ