� K�g�i����dZddlmZddlZddlZddlmcmZddlm Z m Z ddl m Z ddl mZe rddlmZejd ��Zd)d�ZGd�d��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�d e��ZGd!�d"e��ZGd#�d$e��ZGd%�d&e��ZGd'�d(e��ZdS)*a; A block processor parses blocks of text and adds new elements to the ElementTree. Blocks of text, separated from other text by blank lines, may have a different syntax and produce a differently structured tree than other Markdown. Block processors excel at handling code formatting, equation layouts, tables, etc. �)� annotationsN)� TYPE_CHECKING�Any�)�util)� BlockParser)�Markdown�MARKDOWN�mdr �kwargsr�returnrc ��t|��}|j�t|��dd��|j�t |��dd��|j�t |��dd��|j�t |��dd��|j�t|��d d ��|j�t|��d d ��|j�t|��d d��|j�t|��dd��|j�t|��dd��|j�t|��dd��|j�t|��dd��|S)z2 Build the default block parser used by Markdown. �empty�d�indent�Z�code�P� hashheader�F� setextheader�<�hr�2�olist�(�ulist��quote�� reference�� paragraph� )r�blockprocessors�register�EmptyBlockProcessor�ListIndentProcessor�CodeBlockProcessor�HashHeaderProcessor�SetextHeaderProcessor� HRProcessor�OListProcessor�UListProcessor�BlockQuoteProcessor�ReferenceProcessor�ParagraphProcessor)r r �parsers �h/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/markdown/blockprocessors.py�build_block_parserr4*s��� ��_�_�F� ��#�#�$7��$?�$?��#�N�N�N� ��#�#�$7��$?�$?��2�N�N�N� ��#�#�$6�v�$>�$>���K�K�K� ��#�#�$7��$?�$?��r�R�R�R� ��#�#�$9�&�$A�$A�>�SU�V�V�V� ��#�#�K��$7�$7��r�B�B�B� ��#�#�N�6�$:�$:�G�R�H�H�H� ��#�#�N�6�$:�$:�G�R�H�H�H� ��#�#�$7��$?�$?��"�M�M�M� ��#�#�$6�v�$>�$>� �R�P�P�P� ��#�#�$6�v�$>�$>� �R�P�P�P� �M�c�F�eZdZdZdd�Zdd �Zddd�Zd d!d�Zd"d�Zd#d�Z d S)$�BlockProcessoraY Base class for block processors. Each subclass will provide the methods below to work with the source and tree. Each processor will need to define it's own `test` and `run` methods. The `test` method should return True or False, to indicate whether the current block should be processed by this processor. If the test passes, the parser will call the processors `run` method. Attributes: BlockProcessor.parser (BlockParser): The `BlockParser` instance this is attached to. BlockProcessor.tab_length (int): The tab length set on the `Markdown` instance. r2rc�6�||_|jj|_dS�N)r2r � tab_length)�selfr2s r3�__init__zBlockProcessor.__init__Js���� � �)�.����r5�parent� etree.Elementr �etree.Element | Nonec�4�t|��r|dSdS)z. Return the last child of an `etree` element. �����N)�len)r;r=s r3� lastChildzBlockProcessor.lastChildNs�� �v�;�;� ��"�:� ��4r5N�text�str�length� int | None�tuple[str, str]c��|�|j}g}|�d��}|D]b}|�d|z��r|�||d����8|���s|�d���bd�|��d�|t |��d���fS)z= Remove a tab from the front of each line of the given text. N� � �)r:�split� startswith�append�strip�joinrB)r;rDrF�newtext�lines�lines r3�detabzBlockProcessor.detabUs��� �>��_�F���� � �4� � ��� � �D����s�V�|�,�,� ����t�F�G�G�}�-�-�-�-��Z�Z�\�\� ����r�"�"�"�"���y�y��!�!�4�9�9�U�3�w�<�<�=�=�-A�#B�#B�B�Br5r�level�intc��|�d��}tt|����D]C}||�d|jz|z��r|||j|zd�||<�Dd�|��S)z? Remove a tab from front of lines but allowing dedented lines. rJrKN)rM�rangerBrNr:rQ)r;rDrVrS�is r3� looseDetabzBlockProcessor.looseDetabds���� � �4� � ���s�5�z�z�"�"� <� <�A��Q�x�"�"�3�t��#6�u�#<�=�=� <� ��8�D�O�E�$9�$:�$:�;��a����y�y����r5�block�boolc��dS)aZ Test for block type. Must be overridden by subclasses. As the parser loops through processors, it will call the `test` method on each to determine if the given block of text is of that type. This method must return a boolean `True` or `False`. The actual method of testing is left to the needs of that particular block type. It could be as simple as `block.startswith(some_string)` or a complex regular expression. As the block type may be different depending on the parent of the block (i.e. inside a list), the parent `etree` element is also provided and may be used as part of the test. Keyword arguments: parent: An `etree` element which will be the parent of the block. block: A block of text from the source which has been split at blank lines. N��r;r=r\s r3�testzBlockProcessor.testls �� �r5�blocks� list[str]� bool | Nonec��dS)a3 Run processor. Must be overridden by subclasses. When the parser determines the appropriate type of a block, the parser will call the corresponding processor's `run` method. This method should parse the individual lines of the block and append them to the `etree`. Note that both the `parent` and `etree` keywords are pointers to instances of the objects which should be edited in place. Each processor must make changes to the existing objects as there is no mechanism to return new/different objects to replace them. This means that this method should be adding `SubElements` or adding text to the parent, and should remove (`pop`) or add (`insert`) items to the list of blocks. If `False` is returned, this will have the same effect as returning `False` from the `test` method. Keyword arguments: parent: An `etree` element which is the parent of the current block. blocks: A list of all remaining blocks of the document. Nr_)r;r=rbs r3�runzBlockProcessor.run~s ��0 �r5�r2r)r=r>r r?r9)rDrErFrGr rH)r)rDrErVrWr rE�r=r>r\rEr r])r=r>rbrcr rd) �__name__� __module__� __qualname__�__doc__r<rCrUr[rarfr_r5r3r7r7;s������� � �/�/�/�/����� C� C� C� C� C� � � � � � � � � �$ � � � � � r5r7c�T��eZdZdZdgZ ddgZ �fd�Zdd �Zdd�Zdd�Z dd�Z �xZ S)r(z� Process children of list items. Example * a list item process this part or this part �li�ul�olc�v��t��j|�tjd|jz��|_dS)Nz ^(([ ]{%s})+))�superr<�re�compiler:� INDENT_RE)r;�args� __class__s �r3r<zListIndentProcessor.__init__�s4��������$�����$4�t��$F�G�G����r5r=r>r\rEr r]c���|�d|jz��oZ|jj�d�� o:|j|jvp,t|��o|dduo|dj|jvS)NrK�detabbedrA) rNr:r2�state�isstate�tag� ITEM_TYPESrB� LIST_TYPESr`s r3razListIndentProcessor.test�s�������D�O� 3�4�4�:�� �!�)�)�*�5�5� 5�:� �Z�4�?� *�9��V���8����4�!7�8��B�Z�^�t��6�  :r5rbrc�Nonec��|�d��}|�||��\}}|�||��}|jj�d��|j|jvrct|��r7|dj|j vr#|j� |d|g��n�|j� ||g��n�|j|jvr|j� ||g��n�t|��r�|dj|jvr~|dj rOtj d��}|dj |_ d|d_ |d�d|��|j�|d|��n|�||��|jj���dS)NrryrA�prL)�pop� get_levelr[r2rz�setr|r}rBr~� parseBlocksrD�etree�Element�insert� parseChunk� create_item�reset)r;r=rbr\rV�siblingr�s r3rfzListIndentProcessor.run�s���� � �1� � �������6�6���w�����u�-�-�� � ����j�)�)�)� �:��� (� (� �6�{�{� 9�v�b�z�~���@�@�� �'�'��r� �U�G�<�<�<�<�� �'�'����8�8�8�8� �[�D�O� +� +� �K� #� #�G�e�W� 5� 5� 5� 5� ��\�\� -�g�b�k�o���@�@��r�{�� )��M�#�&�&�� ���)���#%��� � ��� �"�"�1�a�(�(�(� �K� "� "�7�2�;�� 6� 6� 6� 6� � � �W�e� ,� ,� ,� � ����!�!�!�!�!r5c�h�tj|d��}|j�||g��dS)z> Create a new `li` and parse the block with it as the parent. rnN)r�� SubElementr2r�)r;r=r\rns r3r�zListIndentProcessor.create_item�s4�� � �f�d� +� +�� � ����U�G�,�,�,�,�,r5�tuple[int, etree.Element]c��|j�|��}|r+t|�d����|jz }nd}|jj�d��rd}nd}||krP|�|��}|�2|j |j vs|j |j vr|j |j vr|dz }|}nn||k�P||fS)z/ Get level of indentation based on list level. rr�list) ru�matchrB�groupr:r2rzr{rCr|r~r})r;r=r\�m� indent_levelrV�childs r3r�zListIndentProcessor.get_level�s��� �N� � �� '� '�� � ��q�w�w�q�z�z�?�?�4�?�:�L�L��L� �;� � $� $�V� ,� ,� ��E�E��E��U�"�"��N�N�6�*�*�E��!�� �T�_�,�,�� �T�_�0L�0L��9���/�/��Q�J�E������U�"�"��f�}�r5rh�r=r>rbrcr r)r=r>r\rEr r)r=r>r\rEr r�) rirjrkrlr}r~r<rarfr�r�� __classcell__�rws@r3r(r(�s�������� � ���J�-����J�9�H�H�H�H�H�:�:�:�:�""�""�""�""�H-�-�-�-� �������r5r(c�"�eZdZdZdd�Zdd �Zd S)r)z Process code blocks. r=r>r\rEr r]c�<�|�d|jz��S)NrK)rNr:r`s r3razCodeBlockProcessor.test�s������D�O� 3�4�4�4r5rbrcrc ���|�|��}|�d��}d}|��|jdkr�t|��r�|djdkrw|d}|�|��\}}t jd�|jt j |� ��������|_n�tj |d��}tj |d��}|�|��\}}t jdt j |� ����z��|_|r|� d|��dSdS)NrrL�prerz{} {} z%s )rCr�r|rBrUr� AtomicString�formatrD� code_escape�rstripr�r�r�)r;r=rbr�r\�theRestrr�s r3rfzCodeBlockProcessor.runsI���.�.��(�(��� � �1� � ���� � �G�K�5�$8�$8� �w�<�<�%9�#�A�J�N�f�4�4��1�:�D�!�Z�Z��.�.�N�E�7��)��!�!�$�)�T�-=�e�l�l�n�n�-M�-M�N�N���D�I�I� �"�6�5�1�1�C��#�C��0�0�D�!�Z�Z��.�.�N�E�7��)�&�4�3C�E�L�L�N�N�3S�3S�*S�T�T�D�I� � &� �M�M�!�W� %� %� %� %� %�  &� &r5Nrhr��rirjrkrlrarfr_r5r3r)r)�sB������ � �5�5�5�5�&�&�&�&�&�&r5r)c�J�eZdZdZejd��Zdd �Zdd �Zdd�Z dS)r/z Process blockquotes. z(^|\n)[ ]{0,3}>[ ]?(.*)r=r>r\rEr r]c�x�t|j�|����otj�� Sr9)r]�RE�searchr�nearing_recursion_limitr`s r3razBlockQuoteProcessor.test!s/���D�G�N�N�5�)�)�*�*�Q�4�3O�3Q�3Q�/Q�Qr5rbrcrc���|�d��}�j�|��}|r�|d|����}�j�||g��d��fd�||���d��d��D����}��|��}|�|j dkr|}ntj |d��}�jj � d���j�||���jj ���dS)NrrJc�:��g|]}��|����Sr_)�clean)�.0rTr;s �r3� <listcomp>z+BlockQuoteProcessor.run.<locals>.<listcomp>-s%���L�L�L�d����D�!�!�L�L�Lr5� blockquote)r�r�r��startr2r�rQrMrCr|r�r�rzr�r�r�)r;r=rbr\r��beforer�rs` r3rfzBlockQuoteProcessor.run$s6���� � �1� � �� �G�N�N�5� !� !�� � ��:�A�G�G�I�I�:�&�F� �K� #� #�F�V�H� 5� 5� 5��I�I�L�L�L�L�e�A�G�G�I�I�J�J�.?�.E�.E�d�.K�.K�L�L�L���E��.�.��(�(�� � �7�;�,�#>�#>��E�E��$�V�\�:�:�E� � ����l�+�+�+� � ���u�e�,�,�,� � ����!�!�!�!�!r5rTc��|j�|��}|���dkrdS|r|�d��S|S)z& Remove `>` from beginning of a line. �>rL�)r�r�rPr�)r;rTr�s r3r�zBlockQuoteProcessor.clean<sJ�� �G�M�M�$� � �� �:�:�<�<�3� � ��2� � ��7�7�1�:�:� ��Kr5Nrhr�)rTrEr rE) rirjrkrlrsrtr�rarfr�r_r5r3r/r/sl������ � � ���.� /� /�B�R�R�R�R�"�"�"�"�0�����r5r/c���eZdZUdZdZded< dZded< dZded < dd gZd ed < d�fd� Z dd�Z dd�Z dd�Z �xZ S)r-z Process ordered list blocks. rprE�TAG�1� STARTSWITHTr]�LAZY_OLrorc� SIBLING_TAGSr2rc�6��t���|��tjd|jdz z��|_tjd|jdz z��|_tjd|j|jdzdz fz��|_dS)Nz^[ ]{0,%d}\d+\.[ ]+(.*)rz!^[ ]{0,%d}((\d+\.)|[*+-])[ ]+(.*)z ^[ ]{%d,%d}((\d+\.)|[*+-])[ ]+.*r�)rrr<rsrtr:r��CHILD_REru�r;r2rws �r3r<zOListProcessor.__init__Ys���� ������ � � ��*�7�4�?�Q�;N�O�P�P���� �#G�$(�O�a�$7�$9�:�:�� ���$G�%)�_�d�o��6I�A�6M�$N�%O�P�P����r5r=r>r\r c�P�t|j�|����Sr9�r]r�r�r`s r3razOListProcessor.testd����D�G�M�M�%�(�(�)�)�)r5rbrc�$�|�|�d����}|�|��}|��U|j|jv�rF|}|djrOt jd��}|dj|_d|d_|d�d|��|�|d��}|�G|j r@t j |dd��}|j � ��|_d|_ t j |d��}|j j �d��|�d��} |j �|| g��|j j ���nG|jdvr|}n;t j ||j��}|js|jdkr|j|jd <|j j �d ��|D]s} | �d |jz��r#|j �|d| g���Bt j |d��}|j �|| g���t|j j ���dS) NrrAr�rLrn� looselist)rpror�r�r�rK)� get_itemsr�rCr|r�rDr�r�r��tailr��lstripr2rzr�r�r�r�r�r��attribrNr:) r;r=rb�itemsr��lstr��lchrn� firstitem�items r3rfzOListProcessor.rungs_�����v�z�z�!�}�}�-�-���.�.��(�(�� � �7�;�$�2C�#C�#C��C��2�w�|� %��M�#�&�&���R�����!��B�� ��B����q�!�$�$�$��.�.��R��)�)�C���3�8���$�S��W�c�2�2������*�*�������!�#�t�,�,�B� �K� � !� !�+� .� .� .�� � �!� � �I� �K� #� #�B�� � 4� 4� 4� �K� � #� #� %� %� %� %� �Z�<� '� '� �C�C��"�6�4�8�4�4�C��<� 6�D�O�s�$:�$:�&*�o�� �7�#� � ����f�%�%�%�� 4� 4�D����s�4�?�2�3�3� 4�� �'�'��B��$��8�8�8�8��%�c�4�0�0��� �'�'��T�F�3�3�3�3� � ����!�!�!�!�!r5c��g}|�d��D�]<}|j�|��}|r�|s^|jdkrSt jd��}|�|�d�������|_|�|�d������|j �|��r[|d� d|j z��r!d� |d|��|d<��|�|����d� |d|��|d<��>|S) z Break a block into list items. rJrpz(\d+)r�rArK�{} {}) rMr�r�r�rsrtr�r�rOrurNr:r�)r;r\r�rTr�� INTEGER_REs r3r�zOListProcessor.get_items�s>�����K�K��%�%� =� =�D�� �#�#�D�)�)�A�� =��K���T�!1�!1�!#��H�!5�!5�J�&0�&6�&6�q�w�w�q�z�z�&B�&B�&H�&H�&J�&J�D�O�� � �Q�W�W�Q�Z�Z�(�(�(�(���%�%�d�+�+� =���9�'�'��D�O�(;�<�<�'� (����b� �4� @� @�E�"�I�I��L�L��&�&�&�&�%�O�O�E�"�I�t�<�<��b� � �� r5rgrhr�)r\rEr rc)rirjrkrlr��__annotations__r�r�r�r<rarfr�r�r�s@r3r-r-Gs���������(�(��C�O�O�O�O�6��J�������G�����*�#�T�l�L�*�*�*�*�� P� P� P� P� P� P�*�*�*�*�9"�9"�9"�9"�v�������r5r-c�6��eZdZUdZdZded< d�fd� Z�xZS) r.z Process unordered list blocks. rorEr�r2rc���t���|��tjd|jdz z��|_dS)Nz^[ ]{0,%d}[*+-][ ]+(.*)r)rrr<rsrtr:r�r�s �r3r<zUListProcessor.__init__�s=��� ������ � � ��*�7�4�?�Q�;N�O�P�P����r5rg)rirjrkrlr�r�r<r�r�s@r3r.r.�s_��������*�*��C�O�O�O�O�6�Q�Q�Q�Q�Q�Q�Q�Q�Q�Qr5r.c�B�eZdZdZejd��Zdd �Zdd �ZdS)r*z Process Hash Headers. z>(?:^|\n)(?P<level>#{1,6})(?P<header>(?:\\.|[^\\])*?)#*(?:\n|$)r=r>r\rEr r]c�P�t|j�|����Sr9)r]r�r�r`s r3razHashHeaderProcessor.test�s���D�G�N�N�5�)�)�*�*�*r5rbrcrc ��|�d��}|j�|��}|�r |d|����}||���d�}|r|j�||g��tj|dt|� d����z��}|� d��� ��|_ |rL|jj �d��r|�|��}|�d|��dSdSt"�d|z��dS)Nr�h%drV�headerr�zWe've got a problem header: %r)r�r�r�r��endr2r�r�r�rBr�rPrDrzr{r[r��logger�warn)r;r=rbr\r�r��after�hs r3rfzHashHeaderProcessor.run�s@��� � �1� � �� �G�N�N�5� !� !�� � B��:�A�G�G�I�I�:�&�F��!�%�%�'�'�(�(�O�E�� :�� �'�'����9�9�9�� ����Q�W�W�W�5E�5E�1F�1F�)F�G�G�A��W�W�X�&�&�,�,�.�.�A�F�� (��;�$�,�,�[�9�9�3�!�O�O�E�2�2�E�� � �a��'�'�'�'�'� (� (� �K�K�8�5�@� A� A� A� A� Ar5Nrhr�) rirjrkrlrsrtr�rarfr_r5r3r*r*�s\������!�!� ���U� V� V�B�+�+�+�+�B�B�B�B�B�Br5r*c�N�eZdZdZejdej��Zdd �Zdd �Z dS)r+z Process Setext-style Headers. z^.*?\n[=-]+[ ]*(\n|$)r=r>r\rEr r]c�P�t|j�|����Sr9r�r`s r3razSetextHeaderProcessor.test�r�r5rbrcrc��|�d���d��}|d�d��rd}nd}tj|d|z��}|d���|_t|��dkr3|�dd� |dd�����dSdS)NrrJr�=r�r�) r�rMrNr�r�rPrDrBr�rQ)r;r=rbrSrVr�s r3rfzSetextHeaderProcessor.run�s���� � �1� � �#�#�D�)�)�� ��8� � �s� #� #� ��E�E��E� � �V�U�U�]� 3� 3���q����!�!��� �u�:�:��>�>� �M�M�!�T�Y�Y�u�Q�R�R�y�1�1� 2� 2� 2� 2� 2� �>r5Nrhr�� rirjrkrlrsrt� MULTILINEr�rarfr_r5r3r+r+�sZ������)�)� ���,�b�l� ;� ;�B�*�*�*�*� 3� 3� 3� 3� 3� 3r5r+c�R�eZdZdZdZejeej��Zdd �Z dd �Z dS)r,z Process Horizontal Rules. zf^[ ]{0,3}(?=(?P<atomicgroup>(-+[ ]{0,2}){3,}|(_+[ ]{0,2}){3,}|(\*+[ ]{0,2}){3,}))(?P=atomicgroup)[ ]*$r=r>r\rEr r]c�P�|j�|��}|r ||_dSdS)NTF)� SEARCH_REr�r�)r;r=r\r�s r3razHRProcessor.test s0�� �N� !� !�%� (� (�� � ��D�J��4��ur5rbrcrc��|�d��}|j}|d|�����d��}|r|j�||g��t j|d��||���d�� d��}|r|� d|��dSdS)NrrJr) r�r�r�r�r2r�r�r�r�r�r�)r;r=rbr\r��prelines� postliness r3rfzHRProcessor.runs���� � �1� � ��� ����%�+�+�-�-��(�/�/��5�5�� � 8� �K� #� #�F�X�J� 7� 7� 7� ����&�&�&��%�)�)�+�+�,�,�'�.�.�t�4�4� � � (� �M�M�!�Y� '� '� '� '� '� (� (r5Nrhr�) rirjrkrlr�rsrtr�r�rarfr_r5r3r,r,s_������%�%� s�B��� �2�r�|�,�,�I�����(�(�(�(�(�(r5r,c�"�eZdZdZdd�Zdd �Zd S)r'z< Process blocks that are empty or start with an empty line. r=r>r\rEr r]c�2�| p|�d��S)NrJ)rNr`s r3razEmptyBlockProcessor.test)s���y�2�E�,�,�T�2�2�2r5rbrcrc��|�d��}d}|r$d}|dd�}|r|�d|��|�|��}|�k|jdkrbt |��rU|djdkrFt jd�|dj|����|d_dSdSdSdSdS)Nrz rJrr�rz{}{}) r�r�rCr|rBrr�r�rD)r;r=rbr\�fillerr�r�s r3rfzEmptyBlockProcessor.run,s���� � �1� � ���� � *��F��A�B�B�i�G�� *�� � �a��)�)�)��.�.��(�(�� � �G�K�5�$8�$8� �w�<�<�%9�#�A�J�N�f�4�4�"�/�� � �g�a�j�o�v�6�6���G�A�J�O�O�O� � �$8�$8�$8�$8�4�4r5Nrhr�r�r_r5r3r'r'&sB������F�F�3�3�3�3������r5r'c�N�eZdZdZejdej��Zdd �Zdd �Z d S)r0z Process link references. z\^[ ]{0,3}\[([^\[\]]*)\]:[ ]*\n?[ ]*([^\s]+)[ ]*(?:\n[ ]*)?((["\'])(.*)\4[ ]*|\((.*)\)[ ]*)?$r=r>r\rEr r]c��dS�NTr_r`s r3razReferenceProcessor.testG����tr5rbrcc���|�d��}|j�|��}|�r�|�d��������}|�d���d���d��}|�d��p|�d��}||f|jj j |<||� ��d����rC|� d||� ��d��d����|d|� ������rC|� d|d|� ����d����d S|� d|��d S) Nrrr��<r���rJTF)r�r�r�r�rP�lowerr�r�r2r � referencesr�r�r�)r;r=rbr\r��id�link�titles r3rfzReferenceProcessor.runJs~��� � �1� � �� �G�N�N�5� !� !�� � �������!�!�#�#�)�)�+�+�B��7�7�1�:�:�$�$�S�)�)�0�0��5�5�D��G�G�A�J�J�,�!�'�'�!�*�*�E�-1�5�M�D�K�N� %�b� )��Q�U�U�W�W�X�X��$�$�&�&� ?�� � �a��q�u�u�w�w�x�x��!7�!7��!=�!=�>�>�>��Z�a�g�g�i�i�Z� �&�&�(�(� A�� � �a��z���� � �z�!2�!9�!9�$�!?�!?�@�@�@��4�� � �a������ur5Nrh)r=r>rbrcr r]r�r_r5r3r0r0As^������$�$� ���g�ik�iu� � �B����������r5r0c�"�eZdZdZdd�Zdd �Zd S)r1z Process Paragraph blocks. r=r>r\rEr r]c��dSr�r_r`s r3razParagraphProcessor.testar�r5rbrcrc��|�d��}|���r�|jj�d��r�|�|��}|�5|jr"d�|j|��|_dSd|z|_dS|jr"d�|j|��|_dS|� ��|_dStj |d��}|� ��|_dSdS)Nrr�r�z %sr�) r�rPr2rzr{rCr�r�rDr�r�r�)r;r=rbr\r�r�s r3rfzParagraphProcessor.runds���� � �1� � �� �;�;�=�=� (��{� �(�(��0�0� (��.�.��0�0���&��|�6�'/���w�|�U�'K�'K�� � � �'-��~�� � � ��{�5�&.�o�o�f�k�5�&I�&I�� � � �&+�l�l�n�n�� � � ��$�V�S�1�1�����������7 (� (r5Nrhr�r�r_r5r3r1r1^sB������%�%�����(�(�(�(�(�(r5r1)r r r rr r) rl� __future__r�loggingrs�xml.etree.ElementTreer�� ElementTree�typingrrrLr� blockparserr�markdownr � getLoggerr�r4r7r(r)r/r-r.r*r+r,r'r0r1r_r5r3�<module>rs���(��#�"�"�"�"�"����� � � � �%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�������$�$�$�$�$�$��"�!�!�!�!�!�!� �� �:� &� &������"[ �[ �[ �[ �[ �[ �[ �[ �|_�_�_�_�_�.�_�_�_�D&�&�&�&�&��&�&�&�B(�(�(�(�(�.�(�(�(�Vs�s�s�s�s�^�s�s�s�l Q� Q� Q� Q� Q�^� Q� Q� Q�!B�!B�!B�!B�!B�.�!B�!B�!B�H3�3�3�3�3�N�3�3�3�.(�(�(�(�(�.�(�(�(�D�����.����6���������:#(�#(�#(�#(�#(��#(�#(�#(�#(�#(r5
Memory