<0Hc@sdZddgZdZdZdZdZdZdZd Zd Z d Z e Z d Z d Ze Zd Zd d kZd d kZd d kZd d kZyd d kZWnej o e ZnXdZy)d d kZd dklZdZWnej o e ZnXy#d dklZdZeZWnNej oByd d kZdZ e ZWnej o e ZnXnXddZ!hdd6dd6dd6dd6dd6Z"h d d!6d"d#6d$e"d%6d&e"d'6d(e"d)6d*e"d+6d,e"d-6d.e"d/6d0d16d2e"d36Z#d4Z$d5Z%d6ei&fd7YZ'd8e'fd9YZ(d:fd;YZ)d<Z*e+d=joe*d>d?dGHnd S(@sThis is Textile A Humane Web Text Generator TODO: * Make it work with Python 2.1. * Make it work with Python 1.5.2? Or that's too optimistic? --- To get an overview of all PyTextile's features, simply type 'tell me about textile.' in a single line. s0Roberto A. F. De Almeida (roberto@dealmeida.net)s$Mark Pilgrim (f8dy@diveintomark.org)s2.0.10s 2004/10/06s Copyright (c) 2004, Roberto A. F. De Almeida, http://dealmeida.net/ Copyright (c) 2003, Mark Pilgrim, http://diveintomark.org/ All rights reserved. Original PHP version: Version 1.0 21 Feb, 2003 Copyright (c) 2003, Dean Allen, www.textism.com All rights reserved. Parts of the documentation and some of the regular expressions are (c) Brad Choate, http://bradchoate.com/. Thanks, Brad! s Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name Textile nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. s 1.0 - 2003/03/19 - MAP - initial release 1.01 - 2003/03/19 - MAP - don't strip whitespace within
 tags;
  map high-bit ASCII to HTML numeric entities
1.02 - 2003/03/19 - MAP - changed hyperlink qtag expression to only
  match valid URL characters (per RFC 2396); fixed preg_replace to
  not match across line breaks (solves lots of problems with
  mistakenly matching overlapping inline markup); fixed whitespace
  stripping to only strip whitespace from beginning and end of lines,
  not immediately before and after HTML tags.
1.03 - 2003/03/20 - MAP - changed hyperlink qtag again to more
  closely match original Textile (fixes problems with links
  immediately followed by punctuation -- somewhere Dean is
  grinning right now); handle curly apostrophe with "ve"
  contraction; clean up empty titles at end.
1.04 - 2003/03/23 - MAP - lstrip input to deal with extra spaces at
  beginning of first line; tweaked list loop to handle consecutive lists
1.1 - 2003/06/06 - MAP - created initial test suite for links and images,
  and fixed a bunch of related bugs to pass them
1.11 - 2003/07/20 - CL - don't demoronise unicode strings; handle
  "they're" properly
1.12 - 2003/07/23 - GW - print debug messages to stderr; handle bq(cite).
1.13 - 2003/07/23 - MAP - wrap bq. text in 

...

2 - 2004/03/26 - RAFA - rewritten from (almost) scratch to include all features from Textile 2 and a little bit more. 2.0.1 - 2004/04/02 - RAFA - Fixed validating function that uses uTidyLib. 2.0.2 - 2004/04/02 - RAFA - Fixed problem with caps letters in URLs. 2.0.3 - 2004/04/19 - RAFA - Multiple classes are allowed, thanks to Dave Anderson. The "lang" attribute is now removed from , to be valid XHTML. Fixed UCAS problem. 2.0.4 - 2004/05/20 - RAFA, CLB - Added inline formatting to table cells. Curt Bergmann fixed a bug with the colspan formatting. Added Amazon Associated id. 2.0.5 - 2004/06/01 - CL - Applied patch from Chris Lawrence to (1) fix that Amazon associates ID was being added to all search URIs, (2) customize the Amazon site used with the AMAZON variable, and (3) added an "isbn" URI type that links directly to an Amazon product by ISBN or Amazon ASIN. 2.0.6 - 2004/06/02 - RAFA - Fixed CAPS problem, again. I hope this is the last time. 2.0.7 - 2004/06/04 - RAFA, MW - Fixed bullet macro, thanks to Adam Messinger. Added patch from Michal Wallace changing {}.pop() for compatibility with Python 2.2.x. 2.0.8 - 2004/06/25 - RAFA - Strip tags when adding the content from a footnote to the reference link. Escaped '<' and '>' in the self- generated documentation. 2.0.9 - 2004/10/04 - RAFA - In images, if ALT is not defined, add an empty attribute. Added "LaTeX" style open/close quotes. Fixed a bug where the acronym definition was being formatted with inline rules. Handle "broken" lines correctly, removing the
from inside split HTML tags. 2.0.10 - 2004/10/06 - RAFA, LO - Escape all non-escaped ampersands. Applied "trivial patch" from Ludvig Omholt to remove newline right after the
 tag.
slatin-1tasciiiswww.amazon.comiNcCs|id|oH|id|dd}|ido|iddd}q\n|id|o|id|dd}n|iidd}|S(sExtracts text from inside a tag.

    This function extracts the text from inside a given tag.
    It's useful to get the text between  or
    
 when using the validators or the colorizer.
    s<%sit>s
s%
(tpreg_replaceR	thtmlizertfilterRtgetvalueR(tcodetcode_intcode_out((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyt_colors	(tTidycCs:ti|dddddd\}}}}t|dS(s]mxTidy's XHTML validator.

        This function is a wrapper to mxTidy's validator.
        toutput_xhtmlitnumeric_entitiestwrapitbody(RttidyR(Rtnerrorst	nwarningst	errortext((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyt_tidy1s-c
Cs:ti|dddddddd}tt|dS(siuTidyLib's XHTML validator.

            This function is a wrapper to uTidyLib's validator.
            Ritadd_xml_declitindentt	tidy_markR(RtparseStringRtstr(R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyt_tidy2s'icCs"t|joti|IJndS(sOutputs debug information to sys.stderr.

    This function outputs debug information if DEBUGLEVEL is
    higher than a given treshold.
    N(t
DEBUGLEVELtsyststderr(tstlevel((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyt_debugs
s(?:(?:<>|[<>=])                 # Either '<>', '<', '>' or '='
                    (?![^\s]*(?:<>|[<>=])))         # Look-ahead to ensure it happens once
                 talignsP(?:[\(\)]+)                     # Any number of '(' and/or ')'
                 tpaddings(                               #
                        (?:\(\#[\w]+\))             # (#id)
                        |                           #
                        (?:\((?:[\w]+(?:\s[\w]+)*)  #
                            (?:\#[\w]+)?\))         # (class1 class2 ... classn#id) or (class1 class2 ... classn)
                    )                               #
                    (?![^\s]*(?:\([\w#]+\)))        # must happen once
                 tclassids(?:\[[\w-]+\])                  # [lang]
                    (?![^\s]*(?:\[.*?\]))           # must happen once
                 tlangs(?:{[^\}]+})                    # {style}
                    (?![^\s]*(?:{.*?}))             # must happen once
                 tstyles/[\!"#\$%&'()\*\+,\-\./:;<=>\?@\[\\\]\^_`{\|}\~]tpunctsp(?=[a-zA-Z0-9./#])                         # Must start correctly
                 (?:                                        # Match the leading part (proto://hostname, or just hostname)
                     (?:ftp|https?|telnet|nntp)             #     protocol
                     ://                                    #     ://
                     (?:                                    #     Optional 'username:password@'
                         \w+                                #         username
                         (?::\w+)?                          #         optional :password
                         @                                  #         @
                     )?                                     # 
                     [-\w]+(?:\.\w[-\w]*)+                  #     hostname (sub.example.com)
                 |                                          #
                     (?:mailto:)?                           #     Optional mailto:
                     [-\+\w]+                               #     username
                     \@                                     #     at
                     [-\w]+(?:\.\w[-\w]*)+                  #     hostname
                 |                                          #
                     (?:[a-z0-9](?:[-a-z0-9]*[a-z0-9])?\.)+ #     domain without protocol
                     (?:com\b                               #     TLD
                     |  edu\b                               #
                     |  biz\b                               #
                     |  gov\b                               #
                     |  in(?:t|fo)\b                        #     .int or .info
                     |  mil\b                               #
                     |  net\b                               #
                     |  org\b                               #
                     |  museum\b                            #
                     |  aero\b                              #
                     |  coop\b                              #
                     |  name\b                              #
                     |  pro\b                               #
                     |  [a-z][a-z]\b                        #     two-letter country codes
                     )                                      #
                 )?                                         #
                 (?::\d+)?                                  # Optional port number
                 (?:                                        # Rest of the URL, optional
                     /?                                     #     Start with '/'
                     [^.!,?;:"'<>()\[\]{}\s\x7F-\xFF]*      #     Can't start with these
                     (?:                                    #
                         [.!,?;:]+                          #     One or more of these
                         [^.!,?;:"'<>()\[\]{}\s\x7F-\xFF]+  #     Can't finish with these
                         #'"                                #     # or ' or "
                     )*                                     #
                 )?                                         #
              turls$(?P                            # 
                     (?: %(align)s                          # alignment
                     |   %(classid)s                        # class and/or id
                     |   %(padding)s                        # padding tags
                     |   %(lang)s                           # [lang]
                     |   %(style)s                          # {style}
                     )+                                     #
                 )?                                         #
              tbattrsM(?P                         # 
                      (?: %(align)s                         # alignment
                      | ((?:\(\#[\w]+\))                    # (#id)
                          |                                 #
                          (?:\((?:[\w]+(?:\s[\w]+)*)        #
                            (?:\#[\w]+)?\))                 # (class1 class2 ... classn#id) or (class1 class2 ... classn)
                      )                                     #
                      |   %(padding)s                       # padding tags
                      |   %(lang)s                          # [lang]
                      |   %(style)s                         # {style}
                      )+                                    #
                  )?                                        #
              tolattrs#(?P                         # 
                      (?: %(align)s                         # alignment
                      |   %(classid)s                       # class and/or id
                      |   %(padding)s                       # padding tags
                      |   %(lang)s                          # [lang]
                      |   %(style)s                         # {style}
                      )+                                    #
                  )?                                        #
              tliattrs(?P                            #
                     (?: %(classid)s                        # class and/or id
                     |   %(lang)s                           # [lang]
                     |   %(style)s                          # {style}
                     )+                                     #
                 )?                                         #
              tqattrs(?P                            # Links attributes
                     (?: %(align)s                          # alignment
                     |   %(classid)s                        # class and/or id
                     |   %(lang)s                           # [lang]
                     |   %(style)s                          # {style}
                     )+                                     #
                 )?                                         #
              tlattrsk(?P                            #
                     (?:                                    #
                     (?: [<>]+                              # horizontal alignment tags
                         (?![^\s]*(?:[<>])))                #     (must happen once)
                     |                                      # 
                     (?: [\-\^~]+                           # vertical alignment tags
                         (?![^\s]*(?:[\-\^~])))             #     (must happen once)
                     | %(classid)s                          # class and/or id
                     | %(padding)s                          # padding tags
                     | %(style)s                            # {style}
                     )+                                     #
                 )?                                         #
              tiattrsT(?:                                       #
                      (?:([\d]+%?)x([\d]+%?))               # 20x10
                      |                                     #
                      (?:                                   # or
                          (?:([\d]+)%?w\s([\d]+)%?h)        #     10h 20w
                          |                                 #     or
                          (?:([\d]+)%?h\s([\d]+)%?w)        #     20w 10h 
                      )                                     #
                  )?                                        #
               tresizes(?P                            #
                     (?:                                    #
                     (?: [\^~]                              # vertical alignment
                         (?![^\s]*(?:[\^~])))               #     (must happen once)
                     |   %(align)s                          # alignment
                     |   %(lang)s                           # [lang]
                     |   %(style)s                          # {style}
                     |   %(classid)s                        # class and/or id
                     |   %(padding)s                        # padding
                     |   _                                  # is this a header row/cell?
                     |   \\\d+                              # colspan
                     |   /\d+                               # rowspan
                     )+                                     #
                 )?                                         #
              ttattrcs8fd}ti|}t||i||S(sAlternative re.sub that handles empty groups.

    This acts like re.sub, except it replaces empty groups with ''
    instead of raising an exception.
    cshd}}t|ixE|iD]7}|p
d}n|id||}|d7}q)W|S(Nits\%s(R(tgroupsR(tmatchobjtcountertrct	matchitem(treplacement(s6/usr/lib/python2.6/site-packages/webhelpers/textile.pytreplacement_funcs

(tretcompileR(tsub(tpatternR>RR?tp((R>s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyRs

cCstid|pt|||Sg}xPtid|D]<}tid|pt|||}n|i|q=Wdi|SdS(sTReplacement outside HTML tags.

    Does a preg_replace only outside HTML tags.
    s<.*>s(<.*?>)s<.*?>R8N(R@tsearchRRtmatchtappendtjoin(RCR>Rtlinestline((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pythtml_replacest_BaseHTMLProcessorc
BseZdddddddddd	d
ddg
Zd
ZdZdZdZdZdZdZ	dZ
dZdZdZ
dZRS(tareatbasetbasefonttbrtcoltframethrtimgtinputtisindextlinktmetatparamcCstii|dS(N(tsgmllibt
SGMLParsert__init__(tself((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyR\scCsg|_tii|dS(N(tpiecesRZR[treset(R]((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyR_s	c	Csg}|D]7\}}||itiid|ifq~}g}|D]3\}}|||djo
|ip|fqV~}|S(NcSstt|idS(i(tunichrtintR9(tm((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pytstrelttype(Rdstype(tlowerRZtcharrefRBR(R]tattrst_[1]tktvt_[2]((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pytnormalize_attrssKGcCsdig}|D]\}}|d||fq~}||ijo|iidtn|iidtdS(NR8s %s="%s"s<%(tag)s%(strattrs)s />s<%(tag)s%(strattrs)s>(RHtelements_no_end_tagR^RGtlocals(R]RRhRitkeytvaluetstrattrs((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pytunknown_starttags:cCs/||ijo|iidtndS(Ns
(RnR^RGRo(R]R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pytunknown_endtagscCs|iidtdS(Ns
&#%(ref)s;(R^RGRo(R]tref((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pythandle_charrefscCs|iidtdS(Ns	&%(ref)s;(R^RGRo(R]Ru((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pythandle_entityref scCs|ii|dS(N(R^RG(R]R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pythandle_data%scCs|iidtdS(Ns(R^RGRo(R]R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pythandle_comment+scCs|iidtdS(Ns(R^RGRo(R]R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyt	handle_pi0scCs|iidtdS(Ns(R^RGRo(R]R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pythandle_decl5scCsdi|iS(s(Return processed HTML as a single stringR8(RHR^(R]((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pytoutput<s(t__name__t
__module__RnR\R_RmRsRtRvRwRxRyRzR{R|(((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyRLs				
							t_HTMLSanitizercGBs8eZdddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFgGZddGdHdIdJdKdLdMdNdOdPdQdRdSdTddUdVdWdXdYdZd[d\dd]d^d_d`dadbdcdddedfdgd'dhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d6d}d~ddddddddddgGZddgZddddddgZddgZeeZeeZdZdZdZ	dZ
dZdZRS(tatabbrtacronymtaddressRMtbtbigt
blockquoteRPtbuttontcaptiontcentertciteRRQtcolgrouptddtdeltdfntdirtdivtdltdttemtfieldsettfonttformth1th2th3th4th5th6RStiRTRUtinstkbdtlabeltlegendtlitmaptmenutoltoptgrouptoptionRDR
tqR&tsamptselecttsmalltspantstriketstrongRBtsupttablettbodyttdttextareattfoottthttheadttrttttutultvartacceptsaccept-charsett	accesskeytactionR)talttaxistbordertcellpaddingtcellspacingtchartcharofftcharsettcheckedtclasstcleartcolstcolspantcolortcompacttcoordstdatetimetdisabledtenctypetforRRtheaderstheightthrefthreflangthspacetidtismapR,tlongdesct	maxlengthtmediatmethodtmultipletnametnohreftnoshadetnowraptprompttreadonlyRdtrevtrowstrowspantrulestscopetselectedtshapetsizetsrctstarttsummaryttabindexttargetttitleRetusemaptvalignRqtvspacetwidthtscripttapplettmathtmitmntmotmrowtmsuptmodetxmlnscCsti|d|_dS(Ni(RLR_tunacceptablestack(R]((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyR__s
cCs||ijo(||ijo|id7_ndS|i|}g}|D]-\}}||ijo|||fqRqR~}ti|||dS(Ni(tacceptable_elementst"unacceptable_elements_with_end_tagRRmtacceptable_attributesRLRs(R]RRhRiRpRq((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyRscsAcCsL||ijo(||ijo|id8_ndSti||dS(Ni(RRRRLRt(R]R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyRtls
cCsdS(N((R]R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyRzsscCsdS(N((R]R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyR{vscCs"|ipti||ndS(N(RRLRx(R]R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyRxys
(
R}R~RRRtmathml_elementstmathml_attributesR_RsRtRzR{Rx(((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyRAs:$

						tTextilercBseZdZddZdZdZeeee	e
dZdZdZ
d%dd	Zhd
dZd%d%d%dZd%d%d
Zd%d%dZd%d%dZd%d%d%dZd%dd%dZd%dd%dZdZd%d%d%dZd%d%d%dZd%d%dZdZdZd%dZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(RS(&sUTextile formatter.

    This is the base class for the PyTextile text processor.
    R8cCs||_t|_h|_d|id\.)              # .
                                (?P\.)?          # Extended paragraph denoted by a second dot
                                \s                       # whitespace
                                (?P.*)             # text
                             s^pre                     # Pre signature
                                %(battr)s                # Pre attributes
                                (?P\.)              # .
                                (?P\.)?          # Extended pre denoted by a second dot
                                \s                       # whitespace
                                (?P.*)             # text
                             s^bc                      # Blockcode signature
                                %(battr)s                # Blockcode attributes
                                (?P\.)              # .
                                (?P\.)?          # Extended blockcode denoted by a second dot
                                \s                       # whitespace
                                (?P.*)             # text
                             sc^bq                      # Blockquote signature
                                %(battr)s                # Blockquote attributes
                                (?P\.)              # .
                                (?P\.)?          # Extended blockquote denoted by a second dot
                                (:(?P              # Optional cite attribute
                                (                        #
                                    %(url)s              #     URL
                                |   "[\w]+(?:\s[\w]+)*"  #     "Name inside quotes"
                                ))                       #
                                )?                       #
                                \s                       # whitespace
                                (?P.*)             # text
                             s^h                       # Header signature
                                (?P
\d) # Header number %(battr)s # Header attributes (?P\.) # . (?P\.)? # Extended header denoted by a second dot \s # whitespace (?P.*) # text s^fn # Footnote signature (?P[\d]+) # Footnote number (?P\.) # . (?P\.)? # Extended footnote denoted by a second dot \s # whitespace (?P.*) # text s^dl # Definition list signature %(battr)s # Definition list attributes (?P\.) # . (?P\.)? # Extended definition list denoted by a second dot \s # whitespace (?P.*) # text s^%(olattr)s # Ordered list attributes \# # Ordered list signature %(liattr)s # List item attributes (?P\.)? # . \s # whitespace (?P.*) # text s^%(olattr)s # Unrdered list attributes \* # Unordered list signature %(liattr)s # Unordered list attributes (?P\.)? # . \s # whitespace (?P.*) # text sE^==?(?P.*?)(==)?$ # Escaped text sB^(?P<.*)$ # XHTML tag s:^(?P # itex code \\\[ # starts with \[ .*? # complicated mathematical equations go here \\\]) # ends with \] s^table # Table signature %(tattr)s # Table attributes (?P\.) # . (?P\.)? # Extended blockcode denoted by a second dot \s # whitespace (?P.*) # text so^(?P \| .*) s&^(?Ptell\sme\sabout\stextile\.)$N(Rtrestsearchestamazon_associate_idRHtAMAZONt paragraphR tbcRtheadertfootnoteRRRtescapetitexRtaboutt signatures(R]R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyR\s4      "&           cCs[|ii|_|iidd|_|iidd|_|i|i|_dS(sVPre-processing of the text. Remove whitespace, fix carriage returns. s s s N(RRRtsanitize(R]((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyt preprocessscCskh}tid|iti}x*|i|iD]\}}|||,
and
. --- h1. Sanitizing Textile can help you generate valid XHTML(eXtensible HyperText Markup Language). It will fix any single tags that are not properly closed, like @@, @
@ and @
@. If you have "mx.Tidy":http://www.egenix.com/files/python/mxTidy.html and/or "µTidyLib":http://utidylib.sourceforge.net/ installed, it also can optionally validade the generated code with these wrappers to ensure 100% valid XHTML(eXtensible HyperText Markup Language). s<(img|br|hr)(.*?)(?:\s*/?\s*)?>s<\1\2 />s%&(?!#?[xX]?(?:[0-9a-fA-F]+|\w{1,8});)s&(R (R]R((s6/usr/lib/python2.6/site-packages/webhelpers/textile.pyRfsc Cs d}d}d}tid|i}g}x|D]}ti||}|o<|id}|ohdd6dd6|}qd }q4x|iD]*\}} ti|titi B} | i|}|o|i } |o1| i d d o|d d d c|7@ can be done this way: pre. h1. This is a header 1. Blocks may continue for multiple paragraphs of text. If you want a block signature to stay "active", use two periods after the signature instead of one. For example: pre.. bq.. This is paragraph one of a block quote. This is paragraph two of a block quote. =p. Now we're back to a regular paragraph. p. Becomes: pre..

This is paragraph one of a block quote.

This is paragraph two of a block quote.

Now we’re back to a regular paragraph.

p. The blocks can be customised by adding parameters between the signature and the period. These include: dl. {style rule}:A CSS(Cascading Style Sheets) style rule. [ll]:A language identifier (for a "lang" attribute). (class) or (#id) or (class#id):For CSS(Cascading Style Sheets) class and id attributes. >, <, =, <>:Modifier characters for alignment. Right-justification, left-justification, centered, and full-justification. The paragraph will also receive the class names "right", "left", "center" and "justify", respectively. ( (one or more):Adds padding on the left. 1em per "(" character is applied. When combined with the align-left or align-right modifier, it makes the block float. ) (one or more):Adds padding on the right. 1em per ")" character is applied. When combined with the align-left or align-right modifier, it makes the block float. Here's an overloaded example: pre. p(())>(class#id)[en]{color:red}. A simple paragraph. Becomes: pre.

A simple paragraph.

s^clear(?P[<>])?\.$is(\n{2,})t alignments clear:left;td?d@dAg} dBdCg} x2| D]*\} } |i| o| |d,(class#id){color:red}[en]. Paragraph. or: p{color:red}[en](class#id)>. Paragraph. will have its parameters parsed to: output = {'lang' : 'en', 'class': 'class', 'id' : 'id', 'style': 'color:red;text-align:right;'} Note that order is not important. R-s(\((?P[\w]+(\s[\w]+)*)(\#[\w]+)?\)Rs"\([\w]*(\s[\w]+)*\#(?P[\w]+)\)Rs\[(?P[\w-]+)\]R,s{(?P