%PDF- %PDF-
Direktori : /lib/python3/dist-packages/markdown/extensions/__pycache__/ |
Current File : //lib/python3/dist-packages/markdown/extensions/__pycache__/wikilinks.cpython-312.pyc |
� ���e� � � � d Z ddlmZ ddlmZ ddlmZ ddlmc m Z ddl Z ddlmZ dd �Z G d � de� Z G d� 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 � t j dd| � }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_urlr s( � ��&�&�2�C��?�K��?�?�4��c�2�2� c �( � � e Zd ZdZ� fd�Zd� Z� xZS )�WikiLinkExtensionz# Add inline processor to Markdown. c �V �� ddgddgddgt dgd�| _ 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 �r r zWikiLinkExtension.__init__( sE �� ��E�F��>�?�%�'H�I�#�%G�H� ��� /� ���"�6�"r c � � || _ d}t || j � � }||_ |j j |dd� y )Nz\[\[([\w0-9_ -]+)\]\]r �K )�md�WikiLinksInlineProcessor� getConfigs�inlinePatterns�register)r! r&