postprocessors
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.
Classes
Postprocessor(markdown_instance=None)
Bases: 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.
Source code in pyrevitlib/pyrevit/coreutils/markdown/util.py
Attributes
markdown = markdown_instance
instance-attribute
Functions
run(text)
Main postprocessor method.
Subclasses of Postprocessor should implement a run
method, which
takes the html document as a single text string and returns a
(possibly modified) string.
Source code in pyrevitlib/pyrevit/coreutils/markdown/postprocessors.py
RawHtmlPostprocessor(markdown_instance=None)
Bases: Postprocessor
Restore raw html to the document.
Source code in pyrevitlib/pyrevit/coreutils/markdown/util.py
Attributes
markdown = markdown_instance
instance-attribute
Functions
run(text)
Iterate over html stash and restore "safe" html.
Source code in pyrevitlib/pyrevit/coreutils/markdown/postprocessors.py
escape(html)
isblocklevel(html)
AndSubstitutePostprocessor(markdown_instance=None)
Bases: Postprocessor
Restore valid entities.
Source code in pyrevitlib/pyrevit/coreutils/markdown/util.py
UnescapePostprocessor(markdown_instance=None)
Bases: Postprocessor
Restore escaped chars.
Source code in pyrevitlib/pyrevit/coreutils/markdown/util.py
Attributes
markdown = markdown_instance
instance-attribute
RE = re.compile('%s(\\d+)%s' % (util.STX, util.ETX))
class-attribute
instance-attribute
Functions
unescape(m)
Functions
build_postprocessors(md_instance, **kwargs)
Build the default postprocessors for Markdown.