U
    muf	                     @   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
ddddgdZeed< i Zd&edddZddddddddd d!d"dddg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k	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   4/tmp/pip-unpacked-wheel-8p1ovdot/mistune/__init__.py
<listcomp>-   s     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 kr*t | | S t|||d}|t |< || S )Nr   )r	   r   r   )__cached_parsersr   )textr	   r   r   keyZmdr   r   r   markdown:   s    
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>   

         