�
K�g � �� � d Z ddlmZ ddlmZ ddlmZmZmZmZm Z ddl
Z
ddlmZm
Z
mZ ddgZ e
j d e
j � � Zd d�Zd!d�Zd"d�Zd"d�Zd#d�Zd$d%d�Zd&d�Zd&d�ZdS )'a�
Python-Markdown provides two serializers which render [`ElementTree.Element`][xml.etree.ElementTree.Element]
objects to a string of HTML. Both functions wrap the same underlying code with only a few minor
differences as outlined below:
1. Empty (self-closing) tags are rendered as `<tag>` for HTML and as `<tag />` for XHTML.
2. Boolean attributes are rendered as `attrname` for HTML and as `attrname="attrname"` for XHTML.
� )�annotations)�ProcessingInstruction)�Comment�ElementTree�Element�QName�
HTML_EMPTYN)�Callable�Literal�NoReturn�to_html_string�to_xhtml_stringz)&(?!(?:\#[0-9]+|\#x[0-9a-f]+|[0-9a-z]+);)�text�str�returnr c �l � t d� | t | � � j � � � � �)Nzcannot serialize {!r} (type {}))� TypeError�format�type�__name__�r s �d/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/markdown/serializers.py�_raise_serialization_errorr : s0 � �
�)�0�0��t�D�z�z�7J�K�K�
�
�
� c �� � d| v rt � d| � � } d| v r| � dd� � } d| v r| � dd� � } | S # t t f$ r t | � � Y d S w xY w)N�&�&�<�<�>�>��RE_AMP�sub�replacer �AttributeErrorr r s r �
_escape_cdatar'