Ë
    Ÿ2Úi1
  ã                  óŽ   — d Z ddlm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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)Ú	Extensionz\{@([^\}]*)=([^\}]*)}c                  ó   — e Zd Zd„ Z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       úW/var/www/html/acx/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                ó:   ‡— ˆ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>.attributeCallback7   s.   ø€ Ø�F‰F�5—;‘;˜q“> 5§;¡;¨q£>×#9Ñ#9¸$ÀÓ#DÕEr   )ÚATTR_REÚsub)r   r   Útxtr    s    `  r   r   zLegacyAttrs.handleAttributes5   s   ø€ ô	Fä�{‰{Ð,¨cÓ2Ð2r   N)Ú__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.extendMarkdown=   s   € à
×Ñ×"Ñ"¤;¨r£?°MÀ2ÕFr   N)r$   r%   r&   r0   r'   r   r   r)   r)   <   s   „ óGr   r)   c                 ó   — t        di | ¤ŽS )Nr'   )r)   )Úkwargss    r   ÚmakeExtensionr3   B   s   € ÜÑ( Ñ(Ð(r   )Ú__doc__Ú
__future__r   ÚreÚmarkdown.treeprocessorsr   r   Úmarkdown.extensionsr   Úcompiler!   r   r)   r3   r'   r   r   ú<module>r:      sJ   ðñ(	õ #ã 	ß ;Ý )ð ˆ"�*‰*Ð-Ó
.€ô3�-ô 3ô&G˜)ô Gó)r   