%PDF- %PDF-
Direktori : /lib/python3/dist-packages/markdown/extensions/__pycache__/ |
Current File : //lib/python3/dist-packages/markdown/extensions/__pycache__/abbr.cpython-312.pyc |
� ���e� � � � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z dd lZdd lm c mZ G d � de� Z G d� d e� Z G d� de� Zd� Zy )z� This extension adds abbreviation handling to Python-Markdown. See the [documentation](https://Python-Markdown.github.io/extensions/abbreviations) for details. � )�annotations� )� Extension� )�BlockProcessor)�InlineProcessor)�AtomicStringNc � � e Zd ZdZd� Zy)� AbbrExtensionz- Abbreviation Extension for Python-Markdown. c �x � |j j j t |j � dd� y)z; Insert `AbbrPreprocessor` before `ReferencePreprocessor`. �abbr� N)�parser�blockprocessors�register�AbbrPreprocessor)�self�mds �:/usr/lib/python3/dist-packages/markdown/extensions/abbr.py�extendMarkdownzAbbrExtension.extendMarkdown$ s) � � � � �!�!�*�*�+;�B�I�I�+F��PR�S� N)�__name__� __module__�__qualname__�__doc__r � r r r r ! s � �7�Tr r c �b � e Zd ZdZ ej dej � Zdd�Zdd�Z d d�Z y) r z= Abbreviation Preprocessor - parse text for abbr references. z6^[*]\[(?P<abbr>[^\]]*)\][ ]?:[ ]*\n?[ ]*(?P<title>.*)$c � � y)NTr )r �parent�blocks r �testzAbbrPreprocessor.test. s � �r c �� � |j d� }| j j |� }|�r2|j d� j � }|j d� j � }| j j j j t | j |� |� d|z d� ||j � d j � r2|j d||j � d j d� � |d|j � j � r2|j d|d|j � j d� � y|j d|� y ) z� Find and remove all Abbreviation references from the text. Each reference is set as a new `AbbrPattern` in the markdown instance. r r �titlezabbr-%sr N� TF)�pop�RE�search�group�stripr r �inlinePatternsr �AbbrInlineProcessor�_generate_pattern�end�insert�lstrip�start�rstrip)r r �blocksr �mr r# s r �runzAbbrPreprocessor.run1 s! � � � � �1� ���G�G�N�N�5�!����7�7�6�?�(�(�*�D��G�G�G�$�*�*�,�E��K�K�N�N�)�)�2�2�#�D�$:�$:�4�$@�%�H�)�VZ�JZ�\]� � �Q�U�U�W�X��$�$�&�� � �a��q�u�u�w�x��!7�!7��!=�>��Z�a�g�g�i� �&�&�(�� � �a��z���� �!2�!9�!9�$�!?�@��� � �a���r c � � t |� }t t |� � D ] }d|| z ||<