
    $g                         d Z ddlmZ ddlmZmZ ddlmZ dZdZ	 G d de          Z
 G d	 d
e          Z G d de          Zd ZdS )a  
Bypass whitespace normalization.

pymdownx._bypassnorm

Strips `SOH` and `EOT` characters before whitespace normalization
allowing other extensions to then create preprocessors that stash HTML
with `SOH` and `EOT`  After whitespace normalization, all `SOH` and
`EOT` characters will be converted to the Python Markdown standard
`STX` and `ETX` convention since whitespace normalization usually
strips out the `STX` and `ETX` characters.

Copyright 2014 - 2018 Isaac Muse <isaacmuse@gmail.com>
    )	Extension)STXETX)Preprocessorc                       e Zd ZdZd ZdS )PreNormalizePreprocessorz*Preprocessor to remove workaround symbols.c                     d                     |          }|                    t          d                              t          d          }|                    d          S )zSRemove workaround placeholder markers before adding actual workaround placeholders.
 )joinreplaceSOHEOTsplitselflinessources      T/var/www/html/netbox-4.1.3/venv/lib/python3.11/site-packages/pymdownx/_bypassnorm.pyrunzPreNormalizePreprocessor.run   sJ     5!!R((00b99||D!!!    N__name__
__module____qualname____doc__r    r   r   r
   r
      s)        44" " " " "r   r
   c                       e Zd ZdZd ZdS )PostNormalizePreprocessorz3Preprocessor to clean up normalization bypass hack.c                     d                     |          }|                    t          t                                        t          t
                    }|                    d          S )zDConvert alternate placeholder symbols to actual placeholder symbols.r   )r   r   r   r   r   r   r   r   s      r   r   zPostNormalizePreprocessor.run&   sJ     5!!S))11#s;;||D!!!r   Nr   r   r   r   r!   r!   #   s)        ==" " " " "r   r!   c                   (     e Zd ZdZ fdZd Z xZS )BypassNormExtensionz Bypass whitespace normalization.c                 V    g | _         i | _         t                      j        |i | dS )zInitialize.N)inlinehiliteconfigsuper__init__)r   argskwargs	__class__s      r   r)   zBypassNormExtension.__init__1   s6     $)&)))))r   c                     |j                             t          |          dd           |j                             t          |          dd           dS )zAAdd extensions that help with bypassing whitespace normalization.zpymdownx-pre-norm-ws#   zpymdownx-post-norm-wsgfffff=@N)preprocessorsregisterr
   r!   )r   mds     r   extendMarkdownz"BypassNormExtension.extendMarkdown8   sV     	!!":2">">@VXZ[[[
!!";B"?"?AXZ^_____r   )r   r   r   r   r)   r2   __classcell__)r,   s   @r   r$   r$   .   sT        *** * * * *` ` ` ` ` ` `r   r$   c                      t          | i |S )zReturn extension.)r$   )r*   r+   s     r   makeExtensionr5   ?   s     ////r   N)r   markdownr   markdown.utilr   r   markdown.preprocessorsr   r   r   r
   r!   r$   r5   r   r   r   <module>r9      s           " " " " " " " " / / / / / /" " " " "| " " "" " " " " " " "` ` ` ` `) ` ` `"0 0 0 0 0r   