Ñò
éíÑXc @ s¨ d Z d d k Z d d k Z e i d Z e d e i Z d d d „ ƒ YZ d e f d „ ƒ YZ d d d
„ ƒ YZ d e f d „ ƒ YZ
d
e f d „ ƒ YZ d S( s²
PRE-PROCESSORS
=============================================================================
Preprocessors work on source text before we start doing anything too
complicated.
iÿÿÿÿNs wzxhzdk:s %dt 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/preprocessors.pyt __init__ s N( t __name__t
__module__t NoneR ( ( ( s: /usr/lib/python2.6/site-packages/markdown/preprocessors.pyR s t Preprocessorc B s e Z d Z d „ Z RS( sF
Preprocessors are run after the text is broken into lines.
Each preprocessor implements a "run" method that takes a pointer to a
list of lines of the document, modifies it as necessary and returns
either the same pointer or a pointer to a new list.
Preprocessors must extend markdown.Preprocessor.
c C s d S( sÕ
Each subclass of Preprocessor should override the `run` method, which
takes the document as a list of strings split by newlines and returns
the (possibly modified) list of lines.
N( ( R t lines( ( s: /usr/lib/python2.6/site-packages/markdown/preprocessors.pyt run s ( R R t __doc__R
( ( ( s: /usr/lib/python2.6/site-packages/markdown/preprocessors.pyR s
t HtmlStashc B s, e Z d Z d „ Z e d „ Z d „ Z RS( s{
This class is used for stashing HTML objects that we extract
in the beginning and replace with place-holders.
c C s d | _ g | _ d S( s Create a HtmlStash. i N( t html_countert
rawHtmlBlocks( R ( ( s: /usr/lib/python2.6/site-packages/markdown/preprocessors.pyR / s c C s6 | i i | | f ƒ t | i } | i d 7_ | S( s:
Saves an HTML segment for later reinsertion. Returns a
placeholder string that needs to be inserted into the
document.
Keyword arguments:
* html: an html segment
* safe: label an html segment as safe for safemode
Returns : a placeholder string
i ( R t appendt HTML_PLACEHOLDERR
( R t htmlt safet placeholder( ( s: /usr/lib/python2.6/site-packages/markdown/preprocessors.pyt store4 s
c C s d | _ g | _ d S( Ni ( R
R ( R ( ( s: /usr/lib/python2.6/site-packages/markdown/preprocessors.pyt resetG s ( R R R R t FalseR R ( ( ( s: /usr/lib/python2.6/site-packages/markdown/preprocessors.pyR ) s t HtmlBlockPreprocessorc B sG e Z d Z d d g Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( sD Remove html blocks from the text and store them for later retrieval.s %s>s %s>c C s | d i d d ƒ d i ƒ S( Ni t >i ( t splitt lower( R t block( ( s: /usr/lib/python2.6/site-packages/markdown/preprocessors.pyt
_get_left_tagQ s c C s xl | i D]a } | | } | i | ƒ } | d j o5 | i d ƒ i d ƒ | t | ƒ d t | ƒ f Sq
W| i ƒ t | ƒ d d !i ƒ t | ƒ f S( Ni t