Ñò éíÑXc@s¨dZddkZddkZeidZedeiZddd„ƒYZdefd„ƒYZd dd „ƒYZ d efd „ƒYZ d efd„ƒYZ dS(s² PRE-PROCESSORS ============================================================================= Preprocessors work on source text before we start doing anything too complicated. iÿÿÿÿNswzxhzdk:s%dt ProcessorcBseZdd„ZRS(cCs|o ||_ndS(N(tmarkdown(tselftmarkdown_instance((s:/usr/lib/python2.6/site-packages/markdown/preprocessors.pyt__init__sN(t__name__t __module__tNoneR(((s:/usr/lib/python2.6/site-packages/markdown/preprocessors.pyRst PreprocessorcBseZdZd„ZRS(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. cCsdS(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((Rtlines((s:/usr/lib/python2.6/site-packages/markdown/preprocessors.pytrun s(RRt__doc__R (((s:/usr/lib/python2.6/site-packages/markdown/preprocessors.pyRs t HtmlStashcBs,eZdZd„Zed„Zd„ZRS(s{ This class is used for stashing HTML objects that we extract in the beginning and replace with place-holders. cCsd|_g|_dS(s Create a HtmlStash. iN(t html_countert rawHtmlBlocks(R((s:/usr/lib/python2.6/site-packages/markdown/preprocessors.pyR/s cCs6|ii||fƒt|i}|id7_|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(RtappendtHTML_PLACEHOLDERR (Rthtmltsafet placeholder((s:/usr/lib/python2.6/site-packages/markdown/preprocessors.pytstore4s cCsd|_g|_dS(Ni(R R(R((s:/usr/lib/python2.6/site-packages/markdown/preprocessors.pytresetGs (RRR RtFalseRR(((s:/usr/lib/python2.6/site-packages/markdown/preprocessors.pyR )s  tHtmlBlockPreprocessorcBsGeZdZddgZd„Zd„Zd„Zd„Zd„ZRS(sDRemove html blocks from the text and store them for later retrieval.ss%s>cCs|diddƒdiƒS(Nit>i(tsplittlower(Rtblock((s:/usr/lib/python2.6/site-packages/markdown/preprocessors.pyt _get_left_tagQscCsxl|iD]a}||}|i|ƒ}|djo5|idƒidƒ|t|ƒdt|ƒfSq W|iƒt|ƒ dd!iƒt|ƒfS(Nits   #s