a
    
d5                     @   s"   d Z ddlmZ G dd dZdS )a  
Python Markdown

A Python implementation of John Gruber's Markdown.

Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/

Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org).
Currently maintained by Waylan Limberg (https://github.com/waylan),
Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser).

Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later)
Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
Copyright 2004 Manfred Stienstra (the original version)

License: BSD (see LICENSE.md for details).
   )parseBoolValuec                   @   sN   e Zd ZdZi Zdd ZdddZdd Zd	d
 Zdd Z	dd Z
dd ZdS )	Extensionz( Base class for extensions to subclass. c                 K   s   |  | dS )z( Initiate Extension and set up configs. N)
setConfigs)selfkwargs r   e/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/markdown/extensions/__init__.py__init__%   s    zExtension.__init__ c                 C   s    || j v r| j | d S |S dS )z8 Return a setting for the given key or an empty string.     Nconfig)r   keydefaultr   r   r   	getConfig)   s    
zExtension.getConfigc                    s    fdd j  D S )z( Return all configs settings as a dict. c                    s   i | ]}|  |qS r   )r   .0r   r   r   r   
<dictcomp>2       z(Extension.getConfigs.<locals>.<dictcomp>r   keysr   r   r   r   
getConfigs0   s    zExtension.getConfigsc                    s    fdd j  D S )z7 Return all `config` descriptions as a list of tuples. c                    s   g | ]}| j | d  fqS )   r   r   r   r   r   
<listcomp>6   r   z+Extension.getConfigInfo.<locals>.<listcomp>r   r   r   r   r   getConfigInfo4   s    zExtension.getConfigInfoc                 C   sL   t | j| d trt|}| j| d du r:t|dd}|| j| d< dS )z: Set a `config` setting for `key` with the given `value`. r   NT)Zpreserve_none)
isinstancer   boolr   )r   r   valuer   r   r   	setConfig8   s
    zExtension.setConfigc                 C   s0   t |dr| }|D ]\}}| || qdS )z@ Set multiple `config` settings given a dict or list of tuples. itemsN)hasattrr    r   )r   r    r   r   r   r   r   r   @   s    
zExtension.setConfigsc                 C   s   t d| jj| jjf dS )z
        Add the various processors and patterns to the Markdown Instance.

        This method must be overridden by every extension.

        Keyword arguments:

        * md: The Markdown instance.

        z8Extension "%s.%s" must define an "extendMarkdown"method.N)NotImplementedError	__class__
__module____name__)r   Zmdr   r   r   extendMarkdownH   s
    zExtension.extendMarkdownN)r
   )r%   r$   __qualname____doc__r   r	   r   r   r   r   r   r&   r   r   r   r   r      s   	
r   N)r(   utilr   r   r   r   r   r   <module>   s   