403Webshell
Server IP : 54.37.205.81  /  Your IP : 216.73.216.76
Web Server : nginx/1.22.1
System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64
User : debian ( 1000)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/markdown/extensions/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/markdown/extensions/__pycache__/codehilite.cpython-311.pyc
�

Ӽ�bo2����dZddlmZddlmZddlmZ	ddlmZddl	m
Z
mZdd	lm
Z
dd
lmZdZn
#e$rdZYnwxYwd
�ZGd�d��ZGd�de��ZGd�de��Zd�ZdS)a�
CodeHilite Extension for Python-Markdown
========================================

Adds code/syntax highlighting to standard Python-Markdown code blocks.

See <https://Python-Markdown.github.io/extensions/code_hilite>
for documentation.

Original code Copyright 2006-2008 [Waylan Limberg](http://achinghead.com/).

All changes Copyright 2008-2014 The Python Markdown Project

License: [BSD](https://opensource.org/licenses/bsd-license.php)

�)�	Extension�)�
Treeprocessor)�parseBoolValue�)�	highlight)�get_lexer_by_name�guess_lexer)�get_formatter_by_name)�
ClassNotFoundTFc��|sgS	ttt|�������S#t$rgcYSwxYw)z�Support our syntax for emphasizing certain lines of code.

    expr should be like '1 2' to emphasize lines 1 and 2 of a code block.
    Returns a list of ints, the line numbers to emphasize.
    )�list�map�int�split�
ValueError)�exprs �@/usr/lib/python3/dist-packages/markdown/extensions/codehilite.py�parse_hl_linesr sZ�����	���C��T�Z�Z�\�\�*�*�+�+�+�������	�	�	����s�3:�A	�A	c�&�eZdZdZd�Zdd�Zd�ZdS)�
CodeHilitea	
    Determine language of source code, and pass it on to the Pygments highlighter.

    Usage:
        code = CodeHilite(src=some_code, lang='python')
        html = code.hilite()

    Arguments:
    * src: Source string or any object with a .readline attribute.

    * lang: String name of Pygments lexer to use for highlighting. Default: `None`.

    * guess_lang: Auto-detect which lexer to use. Ignored if `lang` is set to a valid
      value. Default: `True`.

    * use_pygments: Pass code to pygments for code highlighting. If `False`, the code is
      instead wrapped for highlighting by a JavaScript library. Default: `True`.

    * pygments_formatter: The name of a Pygments formatter or a formatter class used for
      highlighting the code blocks. Default: `html`.

    * linenums: An alias to Pygments `linenos` formatter option. Default: `None`.

    * css_class: An alias to Pygments `cssclass` formatter option. Default: 'codehilite'.

    * lang_prefix: Prefix prepended to the language. Default: "language-".

    Other Options:
    Any other options are accepted and passed on to the lexer and formatter. Therefore,
    valid options include any options which are accepted by the `html` formatter or
    whichever lexer the code's language uses. Note that most lexers do not have any
    options. However, a few have very useful options, such as PHP's `startinline` option.
    Any invalid options are ignored without error.

    Formatter options: https://pygments.org/docs/formatters/#HtmlFormatter
    Lexer Options: https://pygments.org/docs/lexers/

    Additionally, when Pygments is enabled, the code's language is passed to the
    formatter as an extra option `lang_str`, whose value being `{lang_prefix}{lang}`.
    This option has no effect to the Pygments's builtin formatters.

    Advanced Usage:
        code = CodeHilite(
            src = some_code,
            lang = 'php',
            startinline = True,      # Lexer option. Snippet does not start with `<?php`.
            linenostart = 42,        # Formatter option. Snippet starts on line 42.
            hl_lines = [45, 49, 50], # Formatter option. Highlight lines 45, 49, and 50.
            linenos = 'inline'       # Formatter option. Avoid alignment problems.
        )
        html = code.hilite()

    c��||_|�dd��|_|�dd��|_|�dd��|_|�dd��|_|�dd��|_d	|vr|�d
d��|d	<d|vr|�dd
��|d<d|vrd|d<d|d<||_dS)N�lang�
guess_langT�use_pygments�lang_prefix�	language-�pygments_formatter�html�linenos�linenums�cssclass�	css_class�
codehilite�wrapcodeF�full)�src�poprrrrr�options)�selfr'r)s   r�__init__zCodeHilite.__init__gs�������K�K���-�-��	�!�+�+�l�D�9�9���#�K�K���=�=���"�;�;�}�k�B�B���")�+�+�.B�F�"K�"K����G�#�#�!(���Z��!>�!>�G�I���W�$�$�")�+�+�k�<�"H�"H�G�J���W�$�$�"&�G�J�����������Tc���|j�d��|_|j�|r|���t�r+|j�r#	t
|jfi|j��}nc#t$rV	|j	rt|jfi|j��}nt
di|j��}n!#t$rt
di|j��}YnwxYwYnwxYw|js|jd|_|j�|j��}t|jt��r:	t!|jfi|j��}n5#t"$rt!di|j��}YnwxYw|jdd|i|j��}t%|j||��S|j�dd��}|�d	d
��}|�dd��}|�d
d��}g}|jr3|�d�|j|j����|jdr|�d��d}|r(d�d�|����}d�|jd||��S)a7
        Pass code to the [Pygments](http://pygments.pocoo.org/) highliter with
        optional line numbers. The output should then be styled with css to
        your liking. No styles are applied by default - only styling hooks
        (i.e.: <span class="k">).

        returns : A string of html.

        �
N�textrr�lang_str�&�&amp;�<�&lt;�>�&gt;�"z&quot;z{}{}r r!�z class="{}"� z)<pre class="{}"><code{}>{}
</code></pre>
r")r/)r�)r'�stripr�_parseHeader�pygmentsrr	r)rrr
�aliasesr�
isinstancer�strrrr�replace�append�format�join)r*�shebang�lexerr0�	formatter�txt�classes�	class_strs        r�hilitezCodeHilite.hilite{s����8�>�>�$�'�'����9�����������)	��)�)	�	
F�)�$�)�D�D�t�|�D�D�����
F�
F�
F�F���J� +�D�H� E� E��� E� E��� 1� I� I�D�L� I� I����!�F�F�F�-�E�E���E�E�E�E�E�F������

F�����9�
-�!�M�!�,��	��*�7�D�I�7�7�H��$�1�3�7�7�
W�N� 5�d�6M� ^� ^�QU�Q]� ^� ^�I�I��$�N�N�N� 5� M� M��� M� M�I�I�I�N����4�D�3�V�V�X�V���V�V�	��T�X�u�i�8�8�8��(�"�"�3��0�0�C��+�+�c�6�*�*�C��+�+�c�6�*�*�C��+�+�c�8�,�,�C��G��y�
K����v�}�}�T�-=�t�y�I�I�J�J�J��|�I�&�
+����z�*�*�*��I��
D�)�0�0����'�1B�1B�C�C�	�@�G�G���Z�(�����
sH�A&�&
C�10B"�!C�"C�=C�?C�C�C�
D%�%E�Ec���ddl}|j�d��}|�d��}|�d|j��}|�|��}|r�	|�d�����|_	n#t$r
d|_	YnwxYw|�d��r|�d|��|jd�|�d��r
d	|jd<t|�d
����|jd
<n|�d|��d�|���d��|_dS)aH
        Determines language of a code block from shebang line and whether the
        said line should be removed or left in place. If the sheband line
        contains a path (even a single /) then it is assumed to be a real
        shebang line and left alone. However, if no path is given
        (e.i.: #!python or :::python) then it is assumed to be a mock shebang
        for language identification of a code fragment and removed from the
        code block prior to processing for code highlighting. When a mock
        shebang (e.i: #!python) is found, line numbering is turned on. When
        colons are found in place of a shebang (e.i.: :::python), line
        numbering is left in the current state - off by default.

        Also parses optional list of highlight lines, like:

            :::python hl_lines="1 3"
        rNr.a�
            (?:(?:^::+)|(?P<shebang>^[#]!)) # Shebang or 2 or more colons
            (?P<path>(?:/\w+)*[/ ])?        # Zero or 1 path
            (?P<lang>[\w#.+-]*)             # The language
            \s*                             # Arbitrary whitespace
            # Optional highlight lines, single- or double-quote-delimited
            (hl_lines=(?P<quot>"|')(?P<hl_lines>.*?)(?P=quot))?
            r�pathr rET�hl_lines)�rer'rr(�compile�VERBOSE�search�group�lowerr�
IndexError�insertr)rrDr;)r*rO�lines�fl�c�ms      rr<zCodeHilite._parseHeader�sa��$	�	�	�	�����t�$�$��
�Y�Y�q�\�\���J�J���*�
�
��
�H�H�R�L�L���	 �
!��G�G�F�O�O�1�1�3�3��	�	���
!�
!�
!� ��	�	�	�
!�����w�w�v���
$����Q��#�#�#��|�I�&�.�1�7�7�9�3E�3E�.�*.���Y�'�'5�a�g�g�j�6I�6I�'J�'J�D�L��$�$�
�L�L��B�����9�9�U�#�#�)�)�$�/�/����s�',B�B(�'B(N)T)�__name__�
__module__�__qualname__�__doc__r+rKr<r:r,rrr0sR������4�4�l���(9�9�9�9�v50�50�50�50�50r,rc��eZdZdZd�Zd�ZdS)�HiliteTreeprocessorz' Highlight source code in code blocks. c��|�dd��}|�dd��}|�dd��}|S)zUnescape code.r4r3r6r5r2r1)rA)r*r/s  r�
code_unescapez!HiliteTreeprocessor.code_unescape�sB���|�|�F�C�(�(���|�|�F�C�(�(���|�|�G�S�)�)���r,c	���|�d��}|D]�}t|��dkr�|djdkr�|j���}t|�|dj��f|jj	|�
dd��d�|��}|jj�|�
����}|���d|_||_��d	S)
z* Find code blocks and store in htmlStash. �prerr�code�pygments_style�default)�
tab_length�style�pN)�iter�len�tag�config�copyrrbr/�mdrhr(�	htmlStash�storerK�clear)r*�root�blocks�block�local_configre�placeholders       r�runzHiliteTreeprocessor.run�s������5�!�!���	)�	)�E��5�z�z�Q���5��8�<�6�#9�#9�#�{�/�/�1�1��!��&�&�u�Q�x�}�5�5��#�w�1�&�*�*�+;�Y�G�G���#�	���#�g�/�5�5�d�k�k�m�m�D�D�����
�
�
� ��	�(��
��	)�	)r,N)r[r\r]r^rbryr:r,rr`r`�s8������1�1����)�)�)�)�)r,r`c��eZdZdZd�Zd�ZdS)�CodeHiliteExtensionz6 Add source code highlighting to markdown codeblocks. c	�B�ddgddgddgddgdd	gdd
gddgd
dgd�|_|���D]i\}}||jvr|�||���%t|t��r#	t|d���}n#t$rYnwxYw|dg|j|<�jdS)Nz=Use lines numbers. True|table|inline=yes, False=no, None=autoTz,Automatic language detection - Default: Truer$z6Set class name for wrapper <div> - Default: codehilitergz>Pygments HTML Formatter Style (Colorscheme) - Default: defaultFz8Use inline styles instead of CSS classes - Default falsez[Use Pygments to Highlight code blocks. Disable if using a JavaScript library. Default: TruerzQPrefix prepended to the language when use_pygments is false. Default: "language-"rzBUse a specific formatter for Pygments highlighting.Default: "html")r!rr#rf�	noclassesrrr)�
preserve_noner8)rn�items�	setConfigr?r@rr)r*�kwargs�key�values    rr+zCodeHiliteExtension.__init__s-���X�Z��I�K�&�0�1� )� B�C� �*�+�"�-�.�
�c��$*�$5�#%�-����8!�,�,�.�.�	/�	/�J�C���d�k�!�!����s�E�*�*�*�*��e�S�)�)��� .�u�D� I� I� I����%����������$)�2�;���C� � �	/�	/s�0B�
B�Bc��t|��}|���|_|j�|dd��|�|��dS)z/ Add HilitePostprocessor to Markdown instance. rK�N)r`�
getConfigsrn�treeprocessors�register�registerExtension)r*rp�hiliters   r�extendMarkdownz"CodeHiliteExtension.extendMarkdown@sU��%�b�)�)�����*�*���
��"�"�7�H�b�9�9�9�
���T�"�"�"�"�"r,N)r[r\r]r^r+r�r:r,rr{r{s9������@�@�)/�)/�)/�V#�#�#�#�#r,r{c��tdi|��S)Nr:)r{)r�s r�
makeExtensionr�Is���(�(��(�(�(r,N)r^r8rr�r�utilrr=r�pygments.lexersr	r
�pygments.formattersr�
pygments.utilr�ImportErrorrrr`r{r�r:r,r�<module>r�st����"������*�*�*�*�*�*�!�!�!�!�!�!��"�"�"�"�"�"�>�>�>�>�>�>�>�>�9�9�9�9�9�9�+�+�+�+�+�+��H�H�������H�H�H�������� {0�{0�{0�{0�{0�{0�{0�{0�B)�)�)�)�)�-�)�)�)�B4#�4#�4#�4#�4#�)�4#�4#�4#�n)�)�)�)�)s�3�=�=

Youez - 2016 - github.com/yon3zu
LinuXploit