U
    ú±dá  ã                   @   sd   d Z ddlmZ ddlmZmZ ddlZG dd„ deƒZG d	d
„ d
eƒZG dd„ deƒZ	dd„ Z
dS )a±  
Sane List Extension for Python-Markdown
=======================================

Modify the behavior of Lists in Python-Markdown to act in a sane manor.

See <https://Python-Markdown.github.io/extensions/sane_lists>
for documentation.

Original code Copyright 2011 [Waylan Limberg](http://achinghead.com)

All changes Copyright 2011-2014 The Python Markdown Project

License: [BSD](https://opensource.org/licenses/bsd-license.php)

é   )Ú	Extensioné   )ÚOListProcessorÚUListProcessoré    Nc                       s&   e Zd ZdgZdZ‡ fdd„Z‡  ZS )ÚSaneOListProcessorÚolFc                    s&   t ƒ  |¡ t d| jd  ¡| _d S )Nz^[ ]{0,%d}((\d+\.))[ ]+(.*)r   ©ÚsuperÚ__init__ÚreÚcompileZ
tab_lengthZCHILD_RE©ÚselfÚparser©Ú	__class__© úB/tmp/pip-unpacked-wheel-muih9_xp/markdown/extensions/sane_lists.pyr      s    ÿzSaneOListProcessor.__init__)Ú__name__Ú
__module__Ú__qualname__ÚSIBLING_TAGSZLAZY_OLr   Ú__classcell__r   r   r   r   r      s   r   c                       s"   e Zd ZdgZ‡ fdd„Z‡  ZS )ÚSaneUListProcessorÚulc                    s&   t ƒ  |¡ t d| jd  ¡| _d S )Nz^[ ]{0,%d}(([*+-]))[ ]+(.*)r   r	   r   r   r   r   r   &   s    ÿzSaneUListProcessor.__init__)r   r   r   r   r   r   r   r   r   r   r   "   s   r   c                   @   s   e Zd ZdZdd„ ZdS )ÚSaneListExtensionz Add sane lists to Markdown. c                 C   s4   |j j t|j ƒdd¡ |j j t|j ƒdd¡ dS )z Override existing Processors. Zolisté(   Zulisté   N)r   ÚblockprocessorsÚregisterr   r   )r   Zmdr   r   r   ÚextendMarkdown/   s    z SaneListExtension.extendMarkdownN)r   r   r   Ú__doc__r!   r   r   r   r   r   ,   s   r   c                  K   s
   t f | ŽS )N)r   )Úkwargsr   r   r   ÚmakeExtension5   s    r$   )r"   Ú r   r   r   r   r   r   r   r   r$   r   r   r   r   Ú<module>   s   
	