ó Šç\c@@s¹dZddlmZddlmZddlmZddlmZddlmZdd l Z d d d d dddgZ defd„ƒYZ id„Z defd„ƒYZ d S(u­ Python-Markdown Extra Extension =============================== A compilation of various Python-Markdown extensions that imitates [PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/). Note that each of the individual extensions still need to be available on your PYTHONPATH. This extension simply wraps them all up as a convenience so that only one extension needs to be listed when initiating Markdown. See the documentation for each individual extension for specifics about that extension. In the event that one or more of the supported extensions are not available for import, Markdown will issue a warning and simply continue without that extension. There may be additional extensions that are distributed with Python-Markdown that are not included here in Extra. Those extensions are not part of PHP Markdown Extra, and therefore, not part of Python-Markdown Extra. If you really would like Extra to include additional extensions, we suggest creating your own clone of Extra under a differant name. You could also edit the `extensions` global variable defined below, but be aware that such changes may be lost when you upgrade to any future version of Python-Markdown. i(tabsolute_import(tunicode_literalsi(t Extensioni(tBlockProcessor(tutilNu smart_strongu fenced_codeu footnotesu attr_listudef_listutablesuabbrtExtraExtensioncB@seZdZd„ZRS(u* Add various extensions to Markdown class.cC@s‚|jt|jƒ|js~t|jd_|jjj dt |jƒdƒd|jj_ t j dt jƒ|jj_ndS(u Register extension instances. u html_blockumarkdown_blocku_beginiÿÿÿÿu*^(p|h[1-6]|li|dd|dt|td|th|legend|address)$N(tregisterExtensionst extensionstconfigtsafeModetTruet preprocessorstmarkdown_in_rawtparsertblockprocessorstaddtMarkdownInHtmlProcessort tag_countertretcompilet IGNORECASEtcontain_span_tags(tselftmdt md_globals((s=/usr/lib/python2.7/site-packages/markdown/extensions/extra.pytextendMarkdown1s  (t__name__t __module__t__doc__R(((s=/usr/lib/python2.7/site-packages/markdown/extensions/extra.pyR.scC@stdt|ƒƒS(Ntconfigs(Rtdict(R((s=/usr/lib/python2.7/site-packages/markdown/extensions/extra.pyt makeExtension?sRcB@s/eZdZd„Zd„Zded„ZRS(u$Process Markdown Inside HTML Blocks.cC@s$|tjt|jjjdƒkS(Ni(RtTAG_PLACEHOLDERtstrR RR(Rtparenttblock((s=/usr/lib/python2.7/site-packages/markdown/extensions/extra.pyttestEs c C@sg}|jjjd}xmt|jƒ|krˆ|j|drˆ|j|d}|j|d}|j|d|fƒ|d7}qWxTt|d ƒD]B\}\}}|j||||!||||dd!tƒqšW|j|||dd|dd!||ddtƒdS(u1Process the element's child elements in self.run.iu left_indexu right_indexiÿÿÿÿiN( R RRtlent _tag_datatappendt enumeratetrunR ( RtelementR#t nest_indextitleft_child_indextright_child_indext left_indext right_index((s=/usr/lib/python2.7/site-packages/markdown/extensions/extra.pyt_process_nestsIs)#!#c C@s |jjjj|_|jjjd7_|j|jjj}|djdƒ}tj j ||d|dƒ}|r™|jj ||ƒ|d}n$||dd|d!}||d4|jjj j |dƒrå|dksñ|dkrd j|ƒ|_n–|jjjd} t|jƒ| kr‰|j| dr‰|j| dd} |jj ||| ƒ|sœ|j||ƒ}qœn|jj ||ƒdS( Niuattrsumarkdownutagu left_indexu right_indexublockuspanu (R tmarkdownt htmlStashttag_dataR&RRtpopRtetreet SubElementt parseBlocksRtmatchtjointtextR%R1( RR"tblocksttailtnestttagtmarkdown_valueR*R#R,tfirst_subelement_index((s=/usr/lib/python2.7/site-packages/markdown/extensions/extra.pyR)[s,    & N(RRRR$R1tNonetFalseR)(((s=/usr/lib/python2.7/site-packages/markdown/extensions/extra.pyRCs  (Rt __future__RRtRRRRRRRRR(((s=/usr/lib/python2.7/site-packages/markdown/extensions/extra.pyts