
    Mwg                         d Z ddlZd Zd Zy)z4
OOXML has non-standard escaping for characters < 
    Nc                 V    t        j                  d      }d }|j                  ||       S )zB
    Convert ASCII < 31 to OOXML: \n == _x + hex(ord(\n)) + _
    z[\001-\031]c                 T    dj                  t        | j                  d                  S )z*
        Callback to escape chars
        z
_x{:0>4x}_r   )formatordgroupmatchs    L/var/www/horilla/myenv/lib/python3.12/site-packages/openpyxl/utils/escape.py_subzescape.<locals>._sub   s"     ""3u{{1~#677    recompilesub)value
CHAR_REGEXr   s      r
   escaper   
   s*    
 N+J8 >>$&&r   c                 b    t        j                  d      }d }d| v r|j                  ||       } | S )z:
    Convert escaped strings to ASCIII: _x000a_ == \n
    z_x([0-9A-Fa-f]{4})_c                 J    t        t        | j                  d      d            S )z,
        Callback to unescape chars
              )chrintr   r   s    r
   r   zunescape.<locals>._sub"   s     3u{{1~r*++r   _xr   )r   ESCAPED_REGEXr   s      r
   unescaper      s8     JJ45M, u}!!$.Lr   )__doc__r   r   r    r   r
   <module>r      s    
' r   