Ñò éíÑXc@sdZddkZddkZddklZdeiifd„ƒYZdeiifd„ƒYZdei fd „ƒYZ hd „Z dS( s± Definition List Extension for Python-Markdown ============================================= Added parsing of Definition Lists to Python-Markdown. A simple example: Apple : Pomaceous fruit of plants of the genus Malus in the family Rosaceae. : An american computer company. Orange : The fruit of an evergreen tree of the genus Citrus. Copyright 2008 - [Waylan Limberg](http://achinghead.com) iÿÿÿÿN(tetreetDefListProcessorcBs/eZdZeidƒZd„Zd„ZRS(s Process Definition Lists. s"(^|\n)[ ]{0,3}:[ ]{1,3}(.*?)(\n|$)cCst|ii|ƒƒS(N(tbooltREtsearch(tselftparenttblock((s@/usr/lib/python2.6/site-packages/markdown/extensions/def_list.pyttestsc Cs(|idƒ}|ii|ƒ}g}||iƒ idƒD]$}|iƒo||iƒq?q?~}|i||iƒƒ\}} |od|idƒ|f}n|idƒ}|i |ƒ} | oH| i djo8d} | i idƒ}|i | ƒ|i |ƒ} nd} | oV| i djoF| } t | ƒo/| d i d jot | d ƒo d} q’nti|dƒ} x)|D]!} ti| d ƒ}| |_ q™W|iii| ƒti| d ƒ}|ii||gƒ|iiiƒ| o|id| ƒndS( Nis s%s %sitpt looselisttlisttdliÿÿÿÿtddtdt(tpopRRtstarttsplittstriptdetabtendtgroupt lastChildttagttexttremovetlenRt SubElementtparsertstatetsett parseBlockstresettinsert(RRtblocksRtmt_[1]tlttermstdttheResttsiblingRR ttermRR ((s@/usr/lib/python2.6/site-packages/markdown/extensions/def_list.pytrun!s:K 2 (t__name__t __module__t__doc__tretcompileRRR+(((s@/usr/lib/python2.6/site-packages/markdown/extensions/def_list.pyRs tDefListIndentProcessorcBs)eZdZdgZdgZd„ZRS(s5 Process indented children of definition list items. R R cCs/tii|dƒ}tii||gƒdS(s< Create a new dd and parse the block with it as the parent. R N(tmarkdownRRRRR(RRR ((s@/usr/lib/python2.6/site-packages/markdown/extensions/def_list.pyt create_itemQs(R,R-R.t ITEM_TYPESt LIST_TYPESR3(((s@/usr/lib/python2.6/site-packages/markdown/extensions/def_list.pyR1Ks  tDefListExtensioncBseZdZd„ZRS(s# Add definition lists to Markdown. cCsH|iiidt|iƒdƒ|iiidt|iƒdƒdS(s5 Add an instance of DefListProcessor to BlockParser. t defindents>indenttdeflists>ulistN(RtblockprocessorstaddR1R(Rtmdt md_globals((s@/usr/lib/python2.6/site-packages/markdown/extensions/def_list.pytextendMarkdown[s   (R,R-R.R=(((s@/usr/lib/python2.6/site-packages/markdown/extensions/def_list.pyR6XscCs td|ƒS(Ntconfigs(R6(R>((s@/usr/lib/python2.6/site-packages/markdown/extensions/def_list.pyt makeExtensiones( R.R2R/RR9tBlockProcessorRtListIndentProcessorR1t ExtensionR6R?(((s@/usr/lib/python2.6/site-packages/markdown/extensions/def_list.pyts 2