Ñò éíÑXc@skdZddkZdd d„ƒYZdefd„ƒYZdefd„ƒYZd efd „ƒYZdS( s 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. iÿÿÿÿNt ProcessorcBseZdd„ZRS(cCs|o ||_ndS(N(tmarkdown(tselftmarkdown_instance((s;/usr/lib/python2.6/site-packages/markdown/postprocessors.pyt__init__sN(t__name__t __module__tNoneR(((s;/usr/lib/python2.6/site-packages/markdown/postprocessors.pyRst PostprocessorcBseZdZd„ZRS(s 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. cCsdS(s¿ Subclasses of Postprocessor should implement a `run` method, which takes the html document as a single text string and returns a (possibly modified) string. N((Rttext((s;/usr/lib/python2.6/site-packages/markdown/postprocessors.pytruns(RRt__doc__R (((s;/usr/lib/python2.6/site-packages/markdown/postprocessors.pyRs tRawHtmlPostprocessorcBs eZdZd„Zd„ZRS(s# Restore raw html to the document. cCsx t|iiiƒD]õ}|iii|\}}|iiop| oht|iiƒiƒdjo|i|ƒ}q²t|iiƒiƒdjo d}q²ti }n|p|ii o(|i dti i ||dƒ}n|i ti i ||ƒ}qW|S(s2 Iterate over html stash and restore "safe" html. tescapetremovets

%s

s ( trangeRt htmlStasht html_countert rawHtmlBlockstsafeModetstrtlowerR tHTML_REMOVED_TEXTtreplacet preprocessorstHTML_PLACEHOLDER(RR tithtmltsafe((s;/usr/lib/python2.6/site-packages/markdown/postprocessors.pyR +s     cCsF|iddƒ}|iddƒ}|iddƒ}|iddƒS( s Basic html escaping t&s&ts>t"s"(R(RR((s;/usr/lib/python2.6/site-packages/markdown/postprocessors.pyR >s(RRR R R (((s;/usr/lib/python2.6/site-packages/markdown/postprocessors.pyR (s tAndSubstitutePostprocessorcBs eZdZd„Zd„ZRS(s Restore valid entities cCsdS(N((R((s;/usr/lib/python2.6/site-packages/markdown/postprocessors.pyRHscCs|itidƒ}|S(NR(RRtAMP_SUBSTITUTE(RR ((s;/usr/lib/python2.6/site-packages/markdown/postprocessors.pyR Ks(RRR RR (((s;/usr/lib/python2.6/site-packages/markdown/postprocessors.pyR"Fs ((R RRRR R"(((s;/usr/lib/python2.6/site-packages/markdown/postprocessors.pyt s