Ńņ IåHc@sĄdZddkZddklZlZlZlZddkiZddk i Z ddddgZ ei dƒZei d ƒZeiƒd Zd „Z ed „Zd „Zed„ZdS(s<Functions that convert from text markup languages to HTML. i’’’’N(tHTMLtescapetliteraltlit_subtmarkdownt textilizetnl2brtformat_paragraphss \r\n|\n|\rs\n{2,}s cKstti||ƒS(sĄFormat the text to HTML with MarkDown formatting. This function uses the `Python MarkDown library `_ which is included with WebHelpers. It does not include extensions due to circular import issues. If you need the footnotes or RSS extensions, use the full Markdown package instead. IMPORTANT: If your source text is untrusted and may contain malicious HTML markup, pass ``safe_mode="escape"`` to escape it, ``safe_mode="replace"`` to replace it with a scolding message, or ``safe_mode="remove"`` to strip it. There is at least one other Markdown package for Python. python-markdown2 (http://code.google.com/p/python-markdown2/), which claims to be faster and to handle edge cases better. WebHelpers is sticking to the original Python Markdown for now for backward compatibility and because nobody has complained about the speed. (Rt _markdownR(ttexttkwargs((s>/usr/lib/python2.6/site-packages/webhelpers/html/converters.pyRscCs%ti|ƒ}t|id|ƒƒS(s5Format the text to HTML with Textile formatting. This function uses the `PyTextile library `_ which is included with WebHelpers. Additionally, the output can be sanitized which will fix tags like ,
and
for proper XHTML output. tsanitize(ttextiletTextilerRtprocess(R R ttexer((s>/usr/lib/python2.6/site-packages/webhelpers/html/converters.pyR+s cCsF|djo tdƒSttd|ƒ}t|ƒidtƒ}|S(s)Insert a
before each newline. ts N(tNoneRRt_universal_newline_rxRtreplacetbr(R ((s>/usr/lib/python2.6/site-packages/webhelpers/html/converters.pyR8s   cCsŸ|djo tdƒSttd|ƒ}ti|ƒ}xVt|ƒD]H\}}|o"t|ƒ}|idt ƒ}nti |ƒ||. ``preserve_lines``: If true, add
before each single line break Rs s N( RRRRt _paragraph_rxtsplitt enumerateRRRtptjoin(R tpreserve_linest paragraphstitpara((s>/usr/lib/python2.6/site-packages/webhelpers/html/converters.pyRAs    (t__doc__tretwebhelpers.htmlRRRRtwebhelpers.textileR twebhelpers.markdownRRt__all__tcompileRRRtFalseRRR(((s>/usr/lib/python2.6/site-packages/webhelpers/html/converters.pyts "