
    c	                         d Z ddlZddlmZmZ ddlmZ  ej        d          Z G d de          Z	 G d d	e          Z
d
 ZdS )aN  
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).

Legacy Attributes Extension
===========================

An extension to Python Markdown which implements legacy attributes.

Prior to Python-Markdown version 3.0, the Markdown class had an `enable_attributes`
keyword which was on by default and provided for attributes to be defined for elements
using the format `{@key=value}`. This extension is provided as a replacement for
backward compatibility. New documents should be authored using attr_lists. However,
numerious documents exist which have been using the old attribute format for many
years. This extension can be used to continue to render those documents correctly.
    N)TreeprocessorisString)	Extensionz\{@([^\}]*)=([^\}]*)}c                       e Zd Zd Zd ZdS )LegacyAttrsc                    |                                 D ]}|                    dd          }|*|                    d|                     ||                     |j        r4t          |j                  r |                     ||j                  |_        |j        r4t          |j                  r |                     ||j                  |_        dS )z2Find and set values of attributes ({@key=value}). altN)itergetsethandleAttributestextr   tail)selfdocelr	   s       @lib/python3.11/site-packages/markdown/extensions/legacy_attrs.pyrunzLegacyAttrs.run+   s    ((** 	= 	=B&&%%C >ud33B<<===w =8BG,, =//BG<<w =8BG,, =//BG<<	= 	=    c                 D    fd}t                               ||          S )z5 Set attributes and return text without definitions. c                                          |                     d          |                     d                              dd                     d S )N      
 )r   groupreplace)matchr   s    r   attributeCallbackz7LegacyAttrs.handleAttributes.<locals>.attributeCallback8   sA    FF5;;q>>5;;q>>#9#9$#D#DEEEEEr   )ATTR_REsub)r   r   txtr   s    `  r   r   zLegacyAttrs.handleAttributes6   s6    	F 	F 	F 	F 	F{{,c222r   N)__name__
__module____qualname__r   r    r   r   r   r   *   s2        	= 	= 	=3 3 3 3 3r   r   c                       e Zd Zd ZdS )LegacyAttrExtensionc                 X    |j                             t          |          dd           d S )Nlegacyattrs   )treeprocessorsregisterr   )r   mds     r   extendMarkdownz"LegacyAttrExtension.extendMarkdown>   s)    
"";r??M2FFFFFr   N)r#   r$   r%   r/   r&   r   r   r(   r(   =   s(        G G G G Gr   r(   c                      t          di | S )Nr&   )r(   )kwargss    r   makeExtensionr2   B   s    (((((r   )__doc__remarkdown.treeprocessorsr   r   markdown.extensionsr   compiler    r   r(   r2   r&   r   r   <module>r8      s    B 
			 ; ; ; ; ; ; ; ; ) ) ) ) ) ) "*-
.
.3 3 3 3 3- 3 3 3&G G G G G) G G G
) ) ) ) )r   