Ñò éíÑXc@sgdZddkZddklZdeiifd„ƒYZdeifd„ƒYZhd„ZdS( sL Tables Extension for Python-Markdown ==================================== Added parsing of tables to Python-Markdown. A simple example: First Header | Second Header ------------- | ------------- Content Cell | Content Cell Content Cell | Content Cell Copyright 2009 - [Waylan Limberg](http://achinghead.com) iÿÿÿÿN(tetreetTableProcessorcBs2eZdZd„Zd„Zd„Zd„ZRS(s Process Tables. cCsg|idƒ}t|ƒdjoEd|djo4d|djo#d|djo|dddjS( Ns it|iit-t:(RRR(tsplittlen(tselftparenttblocktrows((s>/usr/lib/python2.6/site-packages/markdown/extensions/tables.pyttests$"c Csr|idƒidƒ}|d }|d}t}|didƒo t}ng}xž|i|d|ƒD]†}|idƒo!|idƒo|idƒqm|idƒo|idƒqm|idƒo|id ƒqm|id ƒqmWt i |d ƒ} t i | d ƒ} |i |d| ||ƒt i | d ƒ} x$|D]} |i | | ||ƒqNWd S(s& Parse a table block and build table. is iRiRtcentertlefttrightttablettheadttbodyN( tpopRtFalset startswithtTruet _split_rowtendswithtappendtNoneRt SubElementt _build_row( RRtblocksR theaderR tbordertaligntcRRRtrow((s>/usr/lib/python2.6/site-packages/markdown/extensions/tables.pytruns.    c CsÈti|dƒ}d}|idjo d}n|i||ƒ}x}t|ƒD]o\}} ti||ƒ} y||iƒ| _Wntj od| _nX| o| id| ƒqQqQWdS(s) Given a row of text, build table cells. ttrttdRtthtRN( RRttagRt enumeratetstripttextt IndexErrortset( RR!RRRR#R'tcellstitaR ((s>/usr/lib/python2.6/site-packages/markdown/extensions/tables.pyR9s  cCsT|o@|idƒo|d}n|idƒo|d }qGn|idƒS(s) split a row of text into list of cells. Riiÿÿÿÿ(RRR(RR!R((s>/usr/lib/python2.6/site-packages/markdown/extensions/tables.pyRKs (t__name__t __module__t__doc__R R"RR(((s>/usr/lib/python2.6/site-packages/markdown/extensions/tables.pyRs    tTableExtensioncBseZdZd„ZRS(s Add tables to Markdown. cCs&|iiidt|iƒdƒdS(s3 Add an instance of TableProcessor to BlockParser. Rs /usr/lib/python2.6/site-packages/markdown/extensions/tables.pytextendMarkdownXs (R0R1R2R9(((s>/usr/lib/python2.6/site-packages/markdown/extensions/tables.pyR3UscCs td|ƒS(Ntconfigs(R3(R:((s>/usr/lib/python2.6/site-packages/markdown/extensions/tables.pyt makeExtension_s( R2tmarkdownRR5tBlockProcessorRt ExtensionR3R;(((s>/usr/lib/python2.6/site-packages/markdown/extensions/tables.pyts  A