+
    f0i                        R t ^ RIHt ^ RIHt ^ RIHtHtHtHtH	t	 ^ RI
t
^ RIHtHtHt RR.t]
P                   ! R]
P"                  4      tR	 R
 ltR R ltR R ltR R ltR R ltRR R lltR R ltR R ltR# )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]+);)c                    V ^8  d   QhRRRR/# )   textstrreturnr    )formats   "Z/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/markdown/serializers.py__annotate__r   :   s     
 
S 
X 
    c                ^    \        R P                  V \        V 4      P                  4      4      h)zcannot serialize {!r} (type {}))	TypeErrorr   type__name__r   s   &r   _raise_serialization_errorr   :   s)    
)00tDz7J7JK
 
r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   @   s     ) )3 )r   c                     R V 9   d   \         P                  RV 4      p RV 9   d   V P                  RR4      p RV 9   d   V P                  RR4      p V #   \        \        3 d    \        T 4        R# i ; i)&&amp;<&lt;>&gt;NRE_AMPsubreplacer   AttributeErrorr   r   s   &r   _escape_cdatar+   @   so    ) $;::gt,D$;<<V,D$;<<V,D~& )"4()s   AA A32A3c                    V ^8  d   QhRRRR/# r   r   r   r   r   )r   s   "r   r   r   R   s     ) ) ) )r   c                P    R V 9   d   \         P                  RV 4      p RV 9   d   V P                  RR4      p RV 9   d   V P                  RR4      p RV 9   d   V P                  RR4      p RV 9   d   V P                  RR	4      p V #   \        \        3 d    \        T 4        R
# i ; i)r    r!   r"   r#   r$   r%   "&quot;
z&#10;Nr&   r   s   &r   _escape_attribr2   R   s    )$;::gt,D$;<<V,D$;<<V,D4<<<h/D4<<<g.D~& )"4()s   BB B%$B%c                    V ^8  d   QhRRRR/# r-   r   )r   s   "r   r   r   e   s     ) )c )c )r   c                    R V 9   d   \         P                  RV 4      p RV 9   d   V P                  RR4      p RV 9   d   V P                  RR4      p RV 9   d   V P                  RR4      p V #   \        \        3 d    \        T 4        R# i ; i)	r    r!   r"   r#   r$   r%   r/   r0   Nr&   r   s   &r   _escape_attrib_htmlr5   e   s    )$;::gt,D$;<<V,D$;<<V,D4<<<h/D~& )"4()s   A)A, ,BBc               (    V ^8  d   QhRRRRRRRR/# )	r   writezCallable[[str], None]elemr   r   Literal['html', 'xhtml']r   Noner   )r   s   "r   r   r   v   s+     6( 6(0 6( 6(Ia 6(fj 6(r   c                j   VP                   pVP                  pV\        J d   V ! R \        V4      ,          4       EMGV\        J d   V ! R\        V4      ,          4       EM#Vf1   V'       d   V ! \        V4      4       V F  p\        WV4       K  	  EMRp\        V\        4      '       dJ   VP                  R,          R8X  d'   VP                  R,          P                  R^4      w  rcM\        R4      hV ! RV,           4       VP                  4       pV'       d   \        V4      pV F  w  r\        V\        4      '       d   VP                  p\        V	\        4      '       d   V	P                  p	M\        V	4      p	W8X  d   VR	8X  d   V ! R
V	,          4       Ks  V ! RP                  W4      4       K  	  V'       d   V ! R\        V4      ,          4       VR8X  d#   VP                  4       \         9   d
   V ! R4       MV ! R4       V'       d0   VP                  4       R9   d
   V ! V4       MV ! \        V4      4       V F  p\        WV4       K  	  VP                  4       \         9  d   V ! RV,           R,           4       VP"                  '       d   V ! \        VP"                  4      4       R# R# )z	<!--%s-->z<?%s?>N:N   N{:r<   NN}z QName objects must define a tag.r"   htmlz %sz {}="{}"z xmlns="%s"xhtmlz />r$   z</)scriptstyle)tagr   r   r+   r   _serialize_html
isinstancer   split
ValueErroritemssortedr5   r   r2   lowerr   tail)
r7   r8   r   rC   r   enamespace_urirH   kvs
   &&&       r   rD   rD   v   s   
((C99D
g~kM$//0	%	%ht,,-	-%&AEf-  c5!!xx|s"%(XXb\%7%7Q%?"s !CDDcCi

5MEa''Aa''A+A.A6f.%!)$*++A12  ->-#@ABW
!:%L#J99;"55$K--.&1 yy{*,dSj3&'yyymDII&' r   c               $    V ^8  d   QhRRRRRR/# )r   rootr   r   r9   r   r   r   )r   s   "r   r   r      s"      g '? S r   c                d    V f   Q h. pVP                   p\        W0V4       RP                  V4      # )N )appendrD   join)rQ   r   datar7   s   &&  r   _write_htmlrW      s4    DKKEE(774=r   c                    V ^8  d   QhRRRR/# r   elementr   r   r   r   )r   s   "r   r   r      s     F FG F Fr   c                J    \        \        V 4      P                  4       RR7      # )z9Serialize element and its children to a string of HTML5. r?   r   rW   r   getrootrZ   s   &r   r   r      s    {7+335fEEr   c                    V ^8  d   QhRRRR/# rY   r   )r   s   "r   r   r      s     G GW G Gr   c                J    \        \        V 4      P                  4       RR7      # )z9Serialize element and its children to a string of XHTML. r@   r\   r]   r_   s   &r   r   r      s    {7+335gFFr   )r?   )__doc__
__future__r   xml.etree.ElementTreer   r   r   r   r   r   retypingr	   r
   r   __all__compileIr'   r   r+   r2   r5   rD   rW   r   r   r   r   r   <module>rj      sm   J # 7 R R 	 . ..
/	@"$$	G
)$)&)"6(rF
Gr   