Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Markdown / preprocessors.pyc
Size: Mime:
ó
Âö™Wc@@sºdZddlmZddlmZddlmZddlmZddlZd„Zd	ej	fd
„ƒYZ
de
fd„ƒYZd
e
fd„ƒYZde
fd„ƒYZ
dS(u±
PRE-PROCESSORS
=============================================================================

Preprocessors work on source text before we start doing anything too
complicated.
i(tabsolute_import(tunicode_literalsi(tutil(todictNcK@sRtjƒ}t|ƒ|d<|jdkr>t|ƒ|d<nt|ƒ|d<|S(u: Build the default set of preprocessors used by Markdown. unormalize_whitespaceuescapeu
html_blocku	reference(RtOrderedDicttNormalizeWhitespacetsafeModetHtmlBlockPreprocessortReferencePreprocessor(tmd_instancetkwargst
preprocessors((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pytbuild_preprocessorsstPreprocessorcB@seZdZd„ZRS(uF
    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.

    cC@sdS(uÕ
        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((tselftlines((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pytrun%s(t__name__t
__module__t__doc__R(((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyR
s
RcB@seZdZd„ZRS(u. Normalize whitespace for consistant parsing. cC@sŒdj|ƒ}|jtjdƒjtjdƒ}|jddƒjddƒd}|j|jjƒ}tj	dd|ƒ}|j
dƒS(Nu
uu
u
u

u(?<=\n) +\n(tjointreplaceRtSTXtETXt
expandtabstmarkdownt
tab_lengthtretsubtsplit(RRtsource((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyR2s$"(RRRR(((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyR/sRcB@s¢eZdZddgZdZdeZejeejƒZ	ejeejƒZ
eZd„Z
d„Zd„Zd„Zd	„Zd
„Zd„Zd„ZRS(
uDRemove html blocks from the text and store them for later retrieval.u</%s>u%s>uv
        \s+(?P<attr>[^>"'/= ]+)=(?P<q>['"])(?P<value>.*?)(?P=q) # attr="value"
        |                                                       # OR
        \s+(?P<attr1>[^>"'/= ]+)=(?P<value1>[^> ]+)             # attr=value
        |                                                       # OR
        \s+(?P<attr2>[^>"'/= ]+)                                # attr
        u+^\<(?P<tag>[^> ]+)(?P<attrs>(%s)*)\s*\/?\>?cC@s¢|jj|ƒ}|rg|jdƒ}|jdƒ}i}|rKx|jj|ƒD]ï}|jdƒrº|jdƒrž|jdƒ||jdƒjƒ<qDd||jdƒjƒ<qU|jdƒr|jdƒrý|jdƒ||jdƒjƒ<qDd||jdƒjƒ<qU|jdƒrUd||jdƒjƒ<qUqUWn|t|jd	ƒƒ|fS|d
jdd
ƒd	jƒ}|t|ƒdifSdS(
Nutaguattrsuattruvalueuuattr1uvalue1uattr2iiu>i(	tleft_tag_retmatchtgrouptattrs_retfinditertstriptlenRtlower(Rtblocktmttagt	raw_attrstattrstma((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyt
_get_left_tagLs*%# cC@s¢x›|j||ƒ}|dkr%dS|j||ƒ}||ksO|dkr]|t|ƒS|jd|ƒ}|j|||d|ƒ}|dkrdSqdS(Niÿÿÿÿu>i(tfindR%t_recursive_tagfind(Rtltagtrtagtstart_indexR'titj((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyR/gscC@s†x_|jD]T}||}|jd||||ƒ}|dkr
|jdƒjdƒ|fSq
W|jƒ|d!jƒt|ƒfS(Nu<%siu<u>iÿÿÿÿ(tright_tag_patternsR/tlstriptrstripR&R%(Rtleft_tagt
left_indexR'tpR)R3((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyt_get_right_tagys
 cC@sp|ddkrtSd||kr(tS|dkrD|dkrDtS||dkrh|ddkrhtStSdS(	Niu?u@u%u/u--i(u?u@u%(tTruetFalse(RR8t	right_tag((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyt_equal_tagsƒs cC@s
|dkS(Nuhruhr/(uhruhr/((RR)((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyt_is_onelinerscC@sR|jdƒd\}}x.||krI|t||ƒ7}|d7}qW|dS(uÛ
        Same effect as concatenating the strings in items,
        finding the character to which stringindex refers in that string,
        and returning the index of the item in which that character resides.
        udummyii(ii(tappendR%(RtstringindextitemsR3tcount((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyt_stringindex_to_listindex’s
cC@sµx®t|ƒD] \}}|jj|ƒr
|jdj||ƒƒ\}}}|j||dj||ƒƒ\}}|j|||ƒ|}	d|jƒkr/|||||<|jj	j
|||d|	dƒ}
|j||
ƒt|ƒ|	dkr|	d8}	n||	t|ƒd ||	<q­t|ƒ|	dkrR|	d8}	n|	|krk|d}	n|jj	j
dj|||	!ƒƒ}
|||	5|j||
ƒq
q
W|S(u@Find and process html child elements of the given element block.uumarkdowniiu

(t	enumerateRR R-RR;REtkeysRt	htmlStasht	store_tagtinsertR%tstore(RRCR3titemR8R9R+R>t
data_indextright_listindextplaceholder((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyt_nested_markdown_in_htmlŸs0%"



cC@s#dj|ƒ}g}|jdƒ}g}d}d}t}x{|r¹|d}|jdƒrk|d}n|d}|jdƒr‘|d}n|sÿ|jdƒrït|jƒƒdkrï|dd!dkrèd	d
i}}	}
n|j|ƒ\}}	}
|j||	|ƒ\}}|t|ƒkritj	|ƒsH|d	kri|j
d||ƒ|| }ntj	|ƒp…|ddks›|j|ƒq?n|j|ƒrÃ|j|jƒƒq?n|j
ƒjdƒr}|j||ƒr}|jrUd|
jƒkrU||	t|ƒd
!}|j|jjj||
dd
ƒƒ|j|gƒq?|j|jjj|jƒƒƒq?qü|j||ƒrÇtj	|ƒs«|d	krÇ|j|jƒƒt}q?|j|jjj|jƒƒƒq?q¶|j|ƒq?|j|ƒ|j|d|ƒ\}}|j||ƒr?|t|ƒkrp|| |d<|j
d||ƒnt}|jrˆd|
jƒkrˆ|d|	|d<|dt|ƒd
 |d<|t|ƒdrçt|ƒd}nt|ƒd
}|j|jjj||
d|ƒƒt|jjjƒ}
|j|j|ƒƒt|jjjƒ|
}|jjjd|dc|d
7<n%|j|jjjdj|ƒƒƒg}q?q?W|r|jrÒd|
jƒkrÒ|d|	|d<|dt|ƒd
 |d<|t|ƒdr1t|ƒd}nt|ƒd
}|j|jjj||
d|ƒƒt|jjjƒ}
|j|j|ƒƒt|jjjƒ|
}|jjjd|dc|d
7<n%|j|jjjdj|ƒƒƒ|jdƒndj|ƒ}|jdƒS(Nu
u

uiiu<iu!--u--iu!u?u@u%u>umarkdowniÿÿÿÿiuright_index(u!u?u@u%(RtrsplitR=t
startswithR%R$R-R;RtisBlockLevelRJRAR@R7tendswithR?tmarkdown_in_rawRGRRHRItextendRKR<ttag_dataRPR(RRttextt
new_blocksRCR8R>tin_tagR'R9R+RMtright_indextplaceholderslentneststnew_text((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyR½s¼	



'	-

	

(RRRR5t
attrs_patterntleft_tag_patternRtcompiletVERBOSER"RR=RUR-R/R;R?R@RERPR(((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyR;s 			
			
	RcB@sIeZdZdZejdeejƒZejdeƒZd„Z	RS(uA Remove reference definitions from text and store for later use. u$[ ]*(\"(.*)\"|\'(.*)\'|\((.*)\))[ ]*u*^[ ]{0,3}\[([^\]]*)\]:\s*([^ ]*)[ ]*(%s)?$u^%s$c	C@s/g}x"|r*|jdƒ}|jj|ƒ}|r|jdƒjƒjƒ}|jdƒjdƒjdƒ}|jdƒpœ|jdƒpœ|jdƒ}|s|jj|dƒ}|r|jdƒ|jdƒpø|jd	ƒpø|jd
ƒ}qn||f|j	j
|<q	|j|ƒq	W|S(Niiiu<u>iiiii(tpoptRER R!R$R&R6R7tTITLE_RERt
referencesRA(	RRR^tlineR(tidtlinkttttm((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyRGs 	!-
3(
RRRtTITLERRatDOTALLRdReR(((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyR>s(Rt
__future__RRtRRRRt	ProcessorR
RRR(((s4build/lib.linux-x86_64-2.7/markdown/preprocessors.pyt<module>s	
ÿ