‹›
markdown.postprocessors
¶
Post-processors run on the text of the entire document after is has been serialized into a string. Postprocessors should be used to work with the text just before output. Usually, they are used add back sections that were extracted in a preprocessor, fix up outgoing encodings, or wrap the whole document.
‹›
markdown.postprocessors.build_postprocessors(md: Markdown, **kwargs: Any) -> util.Registry[Postprocessor]
¶
Build the default postprocessors for Markdown.
Return a Registry
instance which contains the following collection of classes with their assigned names and priorities.
Class Instance | Name | Priority |
---|---|---|
RawHtmlPostprocessor |
raw_html |
30 |
AndSubstitutePostprocessor |
amp_substitute |
20 |
‹›
markdown.postprocessors.Postprocessor(md: Markdown | None = 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 Postprocessor
.
‹›
markdown.postprocessors.RawHtmlPostprocessor(md: Markdown | None = None)
¶
Bases: Postprocessor
Restore raw html to the document.
‹›
markdown.postprocessors.UnescapePostprocessor(md: Markdown | None = None)
deprecated
¶
Bases: Postprocessor
Deprecated
This class is deprecated and will be removed in the future; use UnescapeTreeprocessor
instead.
Restore escaped chars.