%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__/smarty.cpython-312.pyc

�

���e(+�
�J�dZddlmZddlmZddlmZmZddlm	Z	ddl
mZdd	lm
Z
mZe
rdd
lmZddlmZddlZddlmcmZd
ZdZdZdZdddddddddd�	ZdezZdezZdZdZdZd ezZd!Z d"ezZ!d#ezZ"d$ezZ#d%Z$d&Z%d'Z&ed(zZ'Gd)�d*e�Z(Gd+�d,e�Z)d-�Z*y).z�
Adds conversion of ASCII dashes, quotes and ellipses to their HTML
entity equivalents.

See the [documentation](https://Python-Markdown.github.io/extensions/smarty)
for details.
�)�annotations�)�	Extension�)�HtmlInlineProcessor�HTML_RE)�InlineProcessor)�Registry)�
TYPE_CHECKING�Sequence)�Markdown)�inlinepatternsNz)[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]z[\s.,;:!?)]z[^\ \t\r\n\[\{\(\-\u0002\u0003]u1(\s|&nbsp;|--|–|—|&[mn]dash;|&#8211;|&#8212;)z&mdash;z&ndash;z&hellip;z&laquo;z&raquo;z&lsquo;z&rsquo;z&ldquo;z&rdquo;)	�mdash�ndash�ellipsis�left-angle-quote�right-angle-quote�left-single-quote�right-single-quote�left-double-quote�right-double-quotez
^'(?=%s\B)z
^"(?=%s\B)z"'(?=\w)z'"(?=\w)z(?<!\w)'(?=\d{2}s)z	%s"(?=\w)z"(?=\s)z(?<=%s)"z	%s'(?=\w)z(?<=%s)'(?!\s|s\b|\d)z	'(\s|s\b)�'�"z(?!\>)c��eZdZdd�Zdd�Zy)�SubstituteTextPatternc�L�tj||�||_||_y)z" Replaces matches with some text. N)r�__init__�replace�md)�self�patternrrs    �</usr/lib/python3/dist-packages/markdown/extensions/smarty.pyrzSubstituteTextPattern.__init__�s ���$�$�T�7�3�������c��d}|jD]O}t|t�r||j|�z
}�(||jj
j
|�z
}�Q||jd�|jd�fS)N�r)	r�
isinstance�int�groupr�	htmlStash�store�start�end)r �m�data�result�parts     r"�handleMatchz!SubstituteTextPattern.handleMatch�st�����L�L�	8�D��$��$��!�'�'�$�-�'���$�'�'�+�+�1�1�$�7�7��		8�
�q�w�w�q�z�1�5�5��8�+�+r#N)r!�strrz#Sequence[int | str | etree.Element]rr
)r-z
re.Match[str]r.r2�returnztuple[str, int, int])�__name__�
__module__�__qualname__rr1�r#r"rr�s���,r#rc�`��eZdZdZ�fd�Z								d	d�Zd
d�Zd
d�Zd
d�Zd
d�Z	d�Z
�xZS)�SmartyExtensionz Add Smarty to Markdown. c����ddgddgddgddgidgd�|_	t�|�di|��tt�|_|jj|j
d	i�
��y)NTzEducate quotesFzEducate angled quoteszEducate dasheszEducate ellipseszOverwrite default substitutions)�smart_quotes�smart_angled_quotes�smart_dashes�smart_ellipses�
substitutionsr?)�defaultr7)�config�superr�dictr?�update�	getConfig)r �kwargs�	__class__s  �r"rzSmartyExtension.__init__�s|���!�#3�4�$)�+B�#C�!�#3�4�#�%7�8� �"C�D�
���	/�
���"�6�"�-1�-�-@������!�!�$�.�.��"�.�"M�Nr#c��t|�D]:\}}||fz
}t|�}d||fz}|jj||||z
��<y)Nzsmarty-%s-%d)�	enumerater�inlinePatterns�register)r r�patterns�serie�priority�indr!�names        r"�_addPatternszSmartyExtension._addPatterns�s^��&�h�/�	F�L�C����u��G�+�W�5�G�!�U�C�L�0�D����(�(��$����E�		Fr#c���td|jdf|�}td|jdf|�}|jj|dd�|jj|dd�y)	Nz(?<!-)---(?!-)rz
(?<!-)--(?!-)rzsmarty-em-dashes�2zsmarty-en-dashes�-�rr?rJrK)r r�emDashesPattern�enDashesPatterns    r"�
educateDasheszSmartyExtension.educateDashes�sv��/��� 2� 2�7� ;�=�r�
��0��t�1�1�'�:�<�b�
��	
���$�$�_�6H�"�M����$�$�_�6H�"�Mr#c�t�td|jdf|�}|jj|dd�y)Nz(?<!\.)\.{3}(?!\.)rzsmarty-ellipses�
rU)r r�ellipsesPatterns   r"�educateEllipseszSmartyExtension.educateEllipses�s<��/�!�D�$6�$6�z�$B�#D�b�
��	
���$�$�_�6G��Lr#c���td|jdf|�}td|jdf|�}|jj|dd�|jj|dd�y)	Nz\<\<rz\>\>rzsmarty-left-angle-quotes�(zsmarty-right-angle-quotes�#rU)r r�leftAngledQuotePattern�rightAngledQuotePatterns    r"�educateAngledQuotesz#SmartyExtension.educateAngledQuotes�s~��!6��d�(�(�);�<�>��"
��#8��d�(�(�)<�=�?��#
��	
���$�$�%;�=W�Y[�\����$�$�%<�>Y�[]�^r#c��|jd}|jd}|jd}|jd}t|fft|fft||zfft||zfft
|fftd|fft|fft|dfft|fftd|fft|fft|fft|fff
}|j||dd�y)Nrrrrr�quotes�)r?�singleQuoteStartRe�doubleQuoteStartRe�doubleQuoteSetsRe�singleQuoteSetsRe�decadeAbbrRe�openingSingleQuotesRegex�closingSingleQuotesRegex�closingSingleQuotesRegex2�remainingSingleQuotesRegex�openingDoubleQuotesRegex�closingDoubleQuotesRegex�closingDoubleQuotesRegex2�remainingDoubleQuotesRegexrQ)r r�lsquo�rsquo�ldquo�rdquorLs       r"�
educateQuoteszSmartyExtension.educateQuotes�s����"�"�#6�7���"�"�#7�8���"�"�#6�7���"�"�#7�8��
�%��*�
�%��*�
���� 0�1�
���� 0�1�
�E�8�$�
%��5�z�2�
%��x�0�
&���
�3�
'�%��2�
%��5�z�2�
%��x�0�
&���1�
'�%��2�
��	
���"�h��"�5r#c���|j�}t�|_|dr|j|�|dr|j	|�|dr<|j|�|jj
tt|�dd�|dr|j|�t|�}|j|_|jj
|dd�|jjd	d
g�y)Nr>r;r<�html�Zr=�smartyrrr)�
getConfigsr
rJr\rwrbrKr�HTML_STRICT_RErXr	�treeprocessors�
ESCAPED_CHARS�extend)r r�configs�inlineProcessors    r"�extendMarkdownzSmartyExtension.extendMarkdowns����/�/�#��HP�
����#�$�� � ��$��>�"����r�"��(�)��$�$�R�(�
���&�&�':�>�2�'N�PV�XZ�[��>�"����r�"�)�"�-��)-�)<�)<��&�
���"�"�?�H�a�@�
������c�
�+r#)rr
rLz9Sequence[tuple[str, Sequence[int | str | etree.Element]]]rMr2rNr')rr
r3�None)r4r5r6�__doc__rrQrXr\rbrwr��
__classcell__)rGs@r"r9r9�sY���#�O�F��F�L�F��	F�
�F�N�M�_�6�,,r#r9c��tdi|��S)Nr7)r9)rFs r"�
makeExtensionr�s���$�V�$�$r#)+r��
__future__rr%rrrrr~r	�utilr
�typingrr�markdownr
�re�xml.etree.ElementTree�etree�ElementTree�
punctClass�endOfWordClass�
closeClass�openingQuotesBaser?rfrgrhrirjrorprqrkrlrmrnrrr}rr9r�r7r#r"�<module>r�s��^�#��9�,��*��!�!�
�)�)�>�
���
/�
�	���
��!�"�"�#�"�#�
�
�#�Z�/��"�Z�/��$��#��%��(�*;�;��&��&��3��(�*;�;��4�j�@��(��"��!���9�$��,�/�,�"],�i�],�@%r#

Zerion Mini Shell 1.0