
    ʯeiP                         d dl Z d dlmc mZ d dlmc mZ d dlmZ d dlmZ d dl	m
Z
 dj                  g d      Zde de d	Z G d
 de
      Zy)    N)Tuple)span)InlineProcessor|)leftrightcenterjustifyz\[(?P<align_open>z*)\](?P<content>[^\[]+)\[\/(?P<align_close>z)\]c                   V    e Zd ZdZddej
                  deej                  e	e	f   fdZ
y)AlignProcessorz+Transforms '[right]Test[/right]' into HTML.Nmreturnc                 8   t        |j                               }|d   }|d   } t        d| d      |      }t        j                  t        j
                  t        |                  j                         }||j                  d      |j                  d      fS )a  This function is called whenever a match is found.

        Args:
            m (re.Match): Match object
            data (_type_): [Not used - not sure what this does]

        Returns:
            (etree.Element, int, int): HTML element, with its starting and ending index.
        r      ztext-align: ;)style)
listgroupsr   ETElementTree
fromstringstrgetrootstartend)selfr   datar   aligncontenthtmlels           ^/var/www/html/glpi_dashboard/venv/lib/python3.12/site-packages/markdownlit/extensions/align.pyhandleMatchzAlignProcessor.handleMatch   s     ahhj!q	)2tLq127;^^BMM#d)45==?1771:quuQx''    )N)__name__
__module____qualname____doc__reMatchr   etreeElementintr#    r$   r"   r   r      s,    5(RXX (U5==#s;R5S (r$   r   )r)   xml.etree.ElementTreer+   r   r   typingr   	htbuilderr   markdown.inlinepatternsr   joinSUPPORTED_ALIGNSALIGN_REr   r.   r$   r"   <module>r6      sS    	 % % " "   388BC  011[\l[mmpq(_ (r$   