<s> """<STR_LIT>""" <EOL> import __init__ as markdown <EOL> class Processor : <EOL> def __init__ ( self , markdown_instance = None ) : <EOL> if markdown_instance : <EOL> self . markdown = markdown_instance <EOL> class Postprocessor ( Processor ) : <EOL> """<STR_LIT>""" <EOL> def run ( self , text ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class RawHtmlPostprocessor ( Postprocessor ) : <EOL> """<STR_LIT>""" <EOL> def run ( self , text ) : <EOL> """<STR_LIT>""" <EOL> for i in range ( self . markdown . htmlStash . html_counter ) : <EOL> html , safe = self . markdown . htmlStash . rawHtmlBlocks [ i ] <EOL> if self . markdown . safeMode and not safe : <EOL> if str ( self . markdown . safeMode ) . lower ( ) == '<STR_LIT>' : <EOL> html = self . escape ( html ) <EOL> elif str ( self . markdown . safeMode ) . lower ( ) == '<STR_LIT>' : <EOL> html = '<STR_LIT>' <EOL> else : <EOL> html = markdown . HTML_REMOVED_TEXT <EOL> if safe or not self . markdown . safeMode : <EOL> text = text . replace ( "<STR_LIT>" % <EOL> ( markdown . preprocessors . HTML_PLACEHOLDER % i ) , <EOL> html + "<STR_LIT:\n>" ) <EOL> text = text . replace ( markdown . preprocessors . HTML_PLACEHOLDER % i , <EOL> html ) <EOL> return text <EOL> def escape ( self , html ) : <EOL> """<STR_LIT>""" <EOL> html = html . replace ( '<STR_LIT:&>' , '<STR_LIT>' ) <EOL> html = html . replace ( '<STR_LIT:<>' , '<STR_LIT>' ) <EOL> html = html . replace ( '<STR_LIT:>>' , '<STR_LIT>' ) <EOL> return html . replace ( '<STR_LIT:">' , '<STR_LIT>' ) <EOL> class AndSubstitutePostprocessor ( Postprocessor ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> pass <EOL> def run ( self , text ) : <EOL> text = text . replace ( markdown . AMP_SUBSTITUTE , "<STR_LIT:&>" ) <EOL> return text </s>
