%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/markdown/extensions/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/markdown/extensions/__pycache__/wikilinks.cpython-312.pyc

�

���e����dZddlmZddlmZddlmZddlmcm	Zddl
Z
ddlmZdd	�Z
Gd
�de�ZGd�d
e�Zd�Zy)z�
Converts `[[WikiLinks]]` to relative links.

See the [documentation](https://Python-Markdown.github.io/extensions/wikilinks)
for details.
�)�annotations�)�	Extension�)�InlineProcessorN)�Anyc�V�tjdd|�}dj|||�S)z1 Build a URL from the label, a base, and an end. z([ ]+_)|(_[ ]+)|([ ]+)�_z{}{}{})�re�sub�format)�label�base�end�clean_labels    �?/usr/lib/python3/dist-packages/markdown/extensions/wikilinks.py�	build_urlrs(���&�&�2�C��?�K��?�?�4��c�2�2�c�(��eZdZdZ�fd�Zd�Z�xZS)�WikiLinkExtensionz# Add inline processor to Markdown. c�V��ddgddgddgtdgd�|_	t�|�di|��y)	N�/z%String to append to beginning or URL.zString to append to end of URL.�wikilinkzCSS hook. Leave blank for none.z Callable formats URL from label.)�base_url�end_url�
html_classr�)r�config�super�__init__)�self�kwargs�	__class__s  �rr zWikiLinkExtension.__init__(sE����E�F��>�?�%�'H�I�#�%G�H�	
���	/�
���"�6�"rc��||_d}t||j��}||_|jj	|dd�y)Nz\[\[([\w0-9_ -]+)\]\]r�K)�md�WikiLinksInlineProcessor�
getConfigs�inlinePatterns�register)r!r&�WIKILINK_RE�wikilinkPatterns    r�extendMarkdownz WikiLinkExtension.extendMarkdown2sC�����/��2�;����@Q�R�����
���"�"�?�J��Cr)�__name__�
__module__�__qualname__�__doc__r r-�
__classcell__�r#s@rrr%s���-�#�Drrc�4��eZdZdZd�fd�Zdd�Zdd�Z�xZS)r'z Build link from `wikilink`. c�2��t�|�|�||_y)N)rr r)r!�patternrr#s   �rr z!WikiLinksInlineProcessor.__init__?s���
����!���rc��|jd�j�r�|j�\}}}|jd�j�}|jd|||�}t	j
d�}||_|jd|�|r|jd|�nd}||jd�|jd�fS)Nrr�a�href�class�r)
�group�strip�_getMetar�etree�Element�text�set�startr)	r!�m�datarrrr�urlr8s	         r�handleMatchz$WikiLinksInlineProcessor.handleMatchCs����7�7�1�:����,0�M�M�O�)�H�g�z��G�G�A�J�$�$�&�E�*�$�+�+�k�*�5�(�G�D�C��
�
�c�"�A��A�F�
�E�E�&�#������g�z�*��A��!�'�'�!�*�a�e�e�A�h�&�&rc���|jd}|jd}|jd}t|jd�r�d|jjvr|jjdd}d|jjvr|jjdd}d|jjvr|jjdd}|||fS)	z$ Return meta data or `config` data. rrr�Meta�
wiki_base_urlr�wiki_end_url�wiki_html_class)r�hasattrr&rI)r!rrrs    rr>z!WikiLinksInlineProcessor._getMetaQs����;�;�z�*���+�+�i�(���[�[��.�
��4�7�7�F�#��$�'�'�,�,�.��7�7�<�<��8��;��������-��'�'�,�,�~�6�q�9�� �D�G�G�L�L�0�!�W�W�\�\�*;�<�Q�?�
���*�,�,r)r6�strrzdict[str, Any])rDz
re.Match[str]rErN�returnz$tuple[etree.Element | str, int, int])rOztuple[str, str, str])r.r/r0r1r rGr>r2r3s@rr'r'<s���'��'�-rr'c��tdi|��S)Nr)r)r"s r�
makeExtensionrQ`s���&�v�&�&r)rrNrrNrrNrOrN)r1�
__future__rr;r�inlinepatternsr�xml.etree.ElementTreer?�ElementTreer�typingrrrr'rQrrr�<module>rWsF���#��,�%�%�	��3�D�	�D�.!-��!-�H'r

Zerion Mini Shell 1.0