Ë
    Ájä
  ã                  ó°   — d Z ddlmZ ddlZddlmZmZ ddlmZ ddl	m
Z
 e
r	ddlmc mZ  ej                  d«      Z G d„ d	e«      Z G d
„ de«      Zd„ Zy)a<  
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,
numerous 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.
é    )ÚannotationsN)ÚTreeprocessorÚisString)Ú	Extension)ÚTYPE_CHECKINGz\{@([^\}]*)=([^\}]*)}c                  ó   — e Zd Zdd„Zdd„Zy)ÚLegacyAttrsc                ó¦  — |j                  «       D ]¾  }|j                  dd«      }|�"|j                  d| j                  ||«      «       |j                  r6t        |j                  «      r!| j                  ||j                  «      |_        |j                  sŒˆt        |j                  «      sŒž| j                  ||j                  «      |_        ŒÀ y)z2Find and set values of attributes ({@key=value}). ÚaltN)ÚiterÚgetÚsetÚhandleAttributesÚtextr   Útail)ÚselfÚdocÚelr   s       úS/var/www/html/venv/lib/python3.12/site-packages/markdown/extensions/legacy_attrs.pyÚrunzLegacyAttrs.run.   s–   € à—(‘(–*ˆBØ—&‘&˜ Ó%ˆCØˆØ—‘�u˜d×3Ñ3°B¸Ó<Ô=Ø�wŠwœ8 B§G¡GÔ,Ø×/Ñ/°°B·G±GÓ<�”Ø�w‹wœ8 B§G¡GÕ,Ø×/Ñ/°°B·G±GÓ<�•ñ ó    c                ó<   ‡— dˆfd„}t         j                  ||«      S )z5 Set attributes and return text without definitions. c                ó†   •— ‰j                  | j                  d«      | j                  d«      j                  dd«      «       y )Né   é   Ú
Ú )r   ÚgroupÚreplace)Úmatchr   s    €r   ÚattributeCallbackz7LegacyAttrs.handleAttributes.<locals>.attributeCallback;   s.   ø€ Ø�F‰F�5—;‘;˜q“> 5§;¡;¨q£>×#9Ñ#9¸$ÀÓ#DÕEr   )r    zre.Match[str])ÚATTR_REÚsub)r   r   Útxtr!   s    `  r   r   zLegacyAttrs.handleAttributes9   s   ø€ õ	Fä�{‰{Ð,¨cÓ2Ð2r   N)r   úetree.ElementÚreturnÚNone)r   r%   r$   Ústrr&   r(   )Ú__name__Ú
__module__Ú__qualname__r   r   © r   r   r	   r	   -   s   „ ó	=ô3r   r	   c                  ó   — e Zd Zd„ Zy)ÚLegacyAttrExtensionc                óP   — |j                   j                  t        |«      dd«       y)z) Add `LegacyAttrs` to Markdown instance. Úlegacyattrsé   N)ÚtreeprocessorsÚregisterr	   )r   Úmds     r   ÚextendMarkdownz"LegacyAttrExtension.extendMarkdownA   s   € à
×Ñ×"Ñ"¤;¨r£?°MÀ2ÕFr   N)r)   r*   r+   r5   r,   r   r   r.   r.   @   s   „ óGr   r.   c                 ó   — t        di | ¤ŽS )Nr,   )r.   )Úkwargss    r   ÚmakeExtensionr8   F   s   € ÜÑ( Ñ(Ð(r   )Ú__doc__Ú
__future__r   ÚreÚmarkdown.treeprocessorsr   r   Úmarkdown.extensionsr   Útypingr   Úxml.etree.ElementTreeÚetreeÚElementTreeÚcompiler"   r	   r.   r8   r,   r   r   Ú<module>rC      sV   ðñ(	õ #ã 	ß ;Ý )Ý  áß)Ð)ð ˆ"�*‰*Ð-Ó
.€ô3�-ô 3ô&G˜)ô Gó)r   