Hackfut Security File Manager
Current Path:
/usr/lib/python2.6/site-packages/markdown
usr
/
lib
/
python2.6
/
site-packages
/
markdown
/
📁
..
📄
__init__.py
(20.99 KB)
📄
__init__.pyc
(17.73 KB)
📄
__init__.pyo
(17.73 KB)
📄
blockparser.py
(3.28 KB)
📄
blockparser.pyc
(4.5 KB)
📄
blockparser.pyo
(4.5 KB)
📄
blockprocessors.py
(17.35 KB)
📄
blockprocessors.pyc
(16.86 KB)
📄
blockprocessors.pyo
(16.86 KB)
📄
commandline.py
(3.45 KB)
📄
commandline.pyc
(3.13 KB)
📄
commandline.pyo
(3.13 KB)
📄
etree_loader.py
(1.26 KB)
📄
etree_loader.pyc
(1.18 KB)
📄
etree_loader.pyo
(1.18 KB)
📁
extensions
📄
html4.py
(9.45 KB)
📄
html4.pyc
(6.9 KB)
📄
html4.pyo
(6.85 KB)
📄
inlinepatterns.py
(11.89 KB)
📄
inlinepatterns.pyc
(15.58 KB)
📄
inlinepatterns.pyo
(15.58 KB)
📄
odict.py
(5.04 KB)
📄
odict.pyc
(7.22 KB)
📄
odict.pyo
(7.22 KB)
📄
postprocessors.py
(2.41 KB)
📄
postprocessors.pyc
(3.61 KB)
📄
postprocessors.pyo
(3.61 KB)
📄
preprocessors.py
(6.97 KB)
📄
preprocessors.pyc
(7.24 KB)
📄
preprocessors.pyo
(7.24 KB)
📄
treeprocessors.py
(11.16 KB)
📄
treeprocessors.pyc
(10.82 KB)
📄
treeprocessors.pyo
(10.82 KB)
Editing: postprocessors.py
""" POST-PROCESSORS ============================================================================= Markdown also allows post-processors, which are similar to preprocessors in that they need to implement a "run" method. However, they are run after core processing. """ import markdown class Processor: def __init__(self, markdown_instance=None): if markdown_instance: self.markdown = markdown_instance class Postprocessor(Processor): """ Postprocessors are run after the ElementTree it converted back into text. Each Postprocessor implements a "run" method that takes a pointer to a text string, modifies it as necessary and returns a text string. Postprocessors must extend markdown.Postprocessor. """ def run(self, text): """ Subclasses of Postprocessor should implement a `run` method, which takes the html document as a single text string and returns a (possibly modified) string. """ pass class RawHtmlPostprocessor(Postprocessor): """ Restore raw html to the document. """ def run(self, text): """ Iterate over html stash and restore "safe" html. """ for i in range(self.markdown.htmlStash.html_counter): html, safe = self.markdown.htmlStash.rawHtmlBlocks[i] if self.markdown.safeMode and not safe: if str(self.markdown.safeMode).lower() == 'escape': html = self.escape(html) elif str(self.markdown.safeMode).lower() == 'remove': html = '' else: html = markdown.HTML_REMOVED_TEXT if safe or not self.markdown.safeMode: text = text.replace("<p>%s</p>" % (markdown.preprocessors.HTML_PLACEHOLDER % i), html + "\n") text = text.replace(markdown.preprocessors.HTML_PLACEHOLDER % i, html) return text def escape(self, html): """ Basic html escaping """ html = html.replace('&', '&') html = html.replace('<', '<') html = html.replace('>', '>') return html.replace('"', '"') class AndSubstitutePostprocessor(Postprocessor): """ Restore valid entities """ def __init__(self): pass def run(self, text): text = text.replace(markdown.AMP_SUBSTITUTE, "&") return text
Upload File
Create Folder