Linux worldls-302.fr.planethoster.net 4.18.0-553.8.1.lve.el7h.x86_64 #1 SMP Thu Jul 4 15:19:33 UTC 2024 x86_64
LiteSpeed
Server IP : 10.185.0.203 & Your IP : 216.73.217.14
Domains :
Cant Read [ /etc/named.conf ]
User : gerathty
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
python2.7 /
site-packages /
markdown /
extensions /
Delete
Unzip
Name
Size
Permission
Date
Action
__init__.py
1.62
KB
-rw-r--r--
2014-06-07 16:58
__init__.pyc
2.69
KB
-rw-r--r--
2014-06-07 16:58
__init__.pyo
2.69
KB
-rw-r--r--
2014-06-07 16:58
abbr.py
2.89
KB
-rw-r--r--
2014-06-07 16:58
abbr.pyc
4.35
KB
-rw-r--r--
2014-06-07 16:58
abbr.pyo
4.35
KB
-rw-r--r--
2014-06-07 16:58
admonition.py
3.69
KB
-rw-r--r--
2014-06-07 16:58
admonition.pyc
4.28
KB
-rw-r--r--
2014-06-07 16:58
admonition.pyo
4.28
KB
-rw-r--r--
2014-06-07 16:58
attr_list.py
5.99
KB
-rw-r--r--
2014-06-07 16:58
attr_list.pyc
6.14
KB
-rw-r--r--
2014-06-07 16:58
attr_list.pyo
6.14
KB
-rw-r--r--
2014-06-07 16:58
codehilite.py
9.75
KB
-rw-r--r--
2014-06-07 16:58
codehilite.pyc
9.66
KB
-rw-r--r--
2014-06-07 16:58
codehilite.pyo
9.66
KB
-rw-r--r--
2014-06-07 16:58
def_list.py
3.63
KB
-rw-r--r--
2014-06-07 16:58
def_list.pyc
4.29
KB
-rw-r--r--
2014-06-07 16:58
def_list.pyo
4.29
KB
-rw-r--r--
2014-06-07 16:58
extra.py
5.13
KB
-rw-r--r--
2014-06-07 16:58
extra.pyc
5.11
KB
-rw-r--r--
2014-06-07 16:58
extra.pyo
5.11
KB
-rw-r--r--
2014-06-07 16:58
fenced_code.py
5.72
KB
-rw-r--r--
2014-06-07 16:58
fenced_code.pyc
6.32
KB
-rw-r--r--
2014-06-07 16:58
fenced_code.pyo
6.32
KB
-rw-r--r--
2014-06-07 16:58
footnotes.py
10.95
KB
-rw-r--r--
2014-06-07 16:58
footnotes.pyc
11.9
KB
-rw-r--r--
2014-06-07 16:58
footnotes.pyo
11.9
KB
-rw-r--r--
2014-06-07 16:58
headerid.py
6.14
KB
-rw-r--r--
2014-06-07 16:58
headerid.pyc
7.77
KB
-rw-r--r--
2014-06-07 16:58
headerid.pyo
7.77
KB
-rw-r--r--
2014-06-07 16:58
meta.py
2.7
KB
-rw-r--r--
2014-06-07 16:58
meta.pyc
3.35
KB
-rw-r--r--
2014-06-07 16:58
meta.pyo
3.35
KB
-rw-r--r--
2014-06-07 16:58
nl2br.py
868
B
-rw-r--r--
2014-06-07 16:58
nl2br.pyc
1.56
KB
-rw-r--r--
2014-06-07 16:58
nl2br.pyo
1.56
KB
-rw-r--r--
2014-06-07 16:58
sane_lists.py
1.3
KB
-rw-r--r--
2014-06-07 16:58
sane_lists.pyc
2.3
KB
-rw-r--r--
2014-06-07 16:58
sane_lists.pyo
2.3
KB
-rw-r--r--
2014-06-07 16:58
smart_strong.py
1.42
KB
-rw-r--r--
2014-06-07 16:58
smart_strong.pyc
2.11
KB
-rw-r--r--
2014-06-07 16:58
smart_strong.pyo
2.11
KB
-rw-r--r--
2014-06-07 16:58
smarty.py
7.71
KB
-rw-r--r--
2014-06-07 16:58
smarty.pyc
5.26
KB
-rw-r--r--
2014-06-07 16:58
smarty.pyo
5.26
KB
-rw-r--r--
2014-06-07 16:58
tables.py
3.15
KB
-rw-r--r--
2014-06-07 16:58
tables.pyc
3.99
KB
-rw-r--r--
2014-06-07 16:58
tables.pyo
3.99
KB
-rw-r--r--
2014-06-07 16:58
toc.py
9.03
KB
-rw-r--r--
2014-06-07 16:58
toc.pyc
7.49
KB
-rw-r--r--
2014-06-07 16:58
toc.pyo
7.49
KB
-rw-r--r--
2014-06-07 16:58
wikilinks.py
5.2
KB
-rw-r--r--
2014-06-07 16:58
wikilinks.pyc
6.31
KB
-rw-r--r--
2014-06-07 16:58
wikilinks.pyo
6.31
KB
-rw-r--r--
2014-06-07 16:58
Save
Rename
""" Fenced Code Extension for Python Markdown ========================================= This extension adds Fenced Code Blocks to Python-Markdown. >>> import markdown >>> text = ''' ... A paragraph before a fenced code block: ... ... ~~~ ... Fenced code block ... ~~~ ... ''' >>> html = markdown.markdown(text, extensions=['fenced_code']) >>> print html <p>A paragraph before a fenced code block:</p> <pre><code>Fenced code block </code></pre> Works with safe_mode also (we check this because we are using the HtmlStash): >>> print markdown.markdown(text, extensions=['fenced_code'], safe_mode='replace') <p>A paragraph before a fenced code block:</p> <pre><code>Fenced code block </code></pre> Include tilde's in a code block and wrap with blank lines: >>> text = ''' ... ~~~~~~~~ ... ... ~~~~ ... ~~~~~~~~''' >>> print markdown.markdown(text, extensions=['fenced_code']) <pre><code> ~~~~ </code></pre> Language tags: >>> text = ''' ... ~~~~{.python} ... # Some python code ... ~~~~''' >>> print markdown.markdown(text, extensions=['fenced_code']) <pre><code class="python"># Some python code </code></pre> Optionally backticks instead of tildes as per how github's code block markdown is identified: >>> text = ''' ... ````` ... # Arbitrary code ... ~~~~~ # these tildes will not close the block ... `````''' >>> print markdown.markdown(text, extensions=['fenced_code']) <pre><code># Arbitrary code ~~~~~ # these tildes will not close the block </code></pre> If the codehighlite extension and Pygments are installed, lines can be highlighted: >>> text = ''' ... ```hl_lines="1 3" ... line 1 ... line 2 ... line 3 ... ```''' >>> print markdown.markdown(text, extensions=['codehilite', 'fenced_code']) <pre><code><span class="hilight">line 1</span> line 2 <span class="hilight">line 3</span> </code></pre> Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/). Project website: <http://packages.python.org/Markdown/extensions/fenced_code_blocks.html> Contact: markdown@freewisdom.org License: BSD (see ../docs/LICENSE for details) Dependencies: * [Python 2.4+](http://python.org) * [Markdown 2.0+](http://packages.python.org/Markdown/) * [Pygments (optional)](http://pygments.org) """ from __future__ import absolute_import from __future__ import unicode_literals from . import Extension from ..preprocessors import Preprocessor from .codehilite import CodeHilite, CodeHiliteExtension, parse_hl_lines import re class FencedCodeExtension(Extension): def extendMarkdown(self, md, md_globals): """ Add FencedBlockPreprocessor to the Markdown instance. """ md.registerExtension(self) md.preprocessors.add('fenced_code_block', FencedBlockPreprocessor(md), ">normalize_whitespace") class FencedBlockPreprocessor(Preprocessor): FENCED_BLOCK_RE = re.compile(r''' (?P<fence>^(?:~{3,}|`{3,}))[ ]* # Opening ``` or ~~~ (\{?\.?(?P<lang>[a-zA-Z0-9_+-]*))?[ ]* # Optional {, and lang # Optional highlight lines, single- or double-quote-delimited (hl_lines=(?P<quot>"|')(?P<hl_lines>.*?)(?P=quot))?[ ]* }?[ ]*\n # Optional closing } (?P<code>.*?)(?<=\n) (?P=fence)[ ]*$''', re.MULTILINE | re.DOTALL | re.VERBOSE) CODE_WRAP = '<pre><code%s>%s</code></pre>' LANG_TAG = ' class="%s"' def __init__(self, md): super(FencedBlockPreprocessor, self).__init__(md) self.checked_for_codehilite = False self.codehilite_conf = {} def run(self, lines): """ Match and store Fenced Code Blocks in the HtmlStash. """ # Check for code hilite extension if not self.checked_for_codehilite: for ext in self.markdown.registeredExtensions: if isinstance(ext, CodeHiliteExtension): self.codehilite_conf = ext.config break self.checked_for_codehilite = True text = "\n".join(lines) while 1: m = self.FENCED_BLOCK_RE.search(text) if m: lang = '' if m.group('lang'): lang = self.LANG_TAG % m.group('lang') # If config is not empty, then the codehighlite extension # is enabled, so we call it to highlight the code if self.codehilite_conf: highliter = CodeHilite(m.group('code'), linenums=self.codehilite_conf['linenums'][0], guess_lang=self.codehilite_conf['guess_lang'][0], css_class=self.codehilite_conf['css_class'][0], style=self.codehilite_conf['pygments_style'][0], lang=(m.group('lang') or None), noclasses=self.codehilite_conf['noclasses'][0], hl_lines=parse_hl_lines(m.group('hl_lines'))) code = highliter.hilite() else: code = self.CODE_WRAP % (lang, self._escape(m.group('code'))) placeholder = self.markdown.htmlStash.store(code, safe=True) text = '%s\n%s\n%s'% (text[:m.start()], placeholder, text[m.end():]) else: break return text.split("\n") def _escape(self, txt): """ basic html escaping """ txt = txt.replace('&', '&') txt = txt.replace('<', '<') txt = txt.replace('>', '>') txt = txt.replace('"', '"') return txt def makeExtension(configs=None): return FencedCodeExtension(configs=configs)