%PDF- %PDF-
| Direktori : /lib/python3/dist-packages/markdown/extensions/__pycache__/ |
| Current File : //lib/python3/dist-packages/markdown/extensions/__pycache__/legacy_attrs.cpython-312.pyc |
�
���e�
� � � d Z ddlmZ ddlZddlmZmZ ddlmZ ddl m
Z
e
r ddlmc m
Z ej d� Z G d� d e� Z G d
� de� Zd� Zy)
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 Zd Zdd�Zdd�Zy)�LegacyAttrsc � � |j � D ]� }|j dd� }|�"|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 �B/usr/lib/python3/dist-packages/markdown/extensions/legacy_attrs.py�runzLegacyAttrs.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 �<