Ñò éíÑXc @ sk d Z d d k Z d d d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d S( 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 Processorc B s e Z d d „ Z RS( c C s | o | | _ n d S( N( t markdown( t selft markdown_instance( ( s; /usr/lib/python2.6/site-packages/markdown/postprocessors.pyt __init__ s N( t __name__t __module__t NoneR ( ( ( s; /usr/lib/python2.6/site-packages/markdown/postprocessors.pyR s t Postprocessorc B s e Z d Z d „ Z RS( 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. c C s d S( 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( ( R t text( ( s; /usr/lib/python2.6/site-packages/markdown/postprocessors.pyt run s ( R R t __doc__R ( ( ( s; /usr/lib/python2.6/site-packages/markdown/postprocessors.pyR s t RawHtmlPostprocessorc B s e Z d Z d „ Z d „ Z RS( s# Restore raw html to the document. c C s xt | i i i ƒ D]õ } | i i i | \ } } | i i op | oh t | i i ƒ i ƒ d j o | i | ƒ } q² t | i i ƒ i ƒ d j o d } q² t i } n | p | i i o( | i d t i i | | d ƒ } n | i t i i | | ƒ } q W| S( s2 Iterate over html stash and restore "safe" html. t escapet removet s
%s
s ( t rangeR t htmlStasht html_countert rawHtmlBlockst safeModet strt lowerR t HTML_REMOVED_TEXTt replacet preprocessorst HTML_PLACEHOLDER( R R t it htmlt safe( ( s; /usr/lib/python2.6/site-packages/markdown/postprocessors.pyR + s c C sF | i d d ƒ } | i d d ƒ } | i d d ƒ } | i d d ƒ S( s Basic html escaping t &s &t