Module Expr Str Import alias Import alias ImportFrom alias alias Assign NameStore Call AttributeLoad NameLoad attr Str BinOpBitOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore Str ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Call NameLoad NameLoad Str decorator_list decorator_list ClassDef bases AttributeLoad AttributeLoad NameLoad attr attr body FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIn NameLoad AttributeLoad NameLoad attr body Return SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Index Num orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot AttributeLoad NameLoad attr body For NameStore AttributeLoad AttributeLoad NameLoad attr attr body If Call NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Break Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad While Num body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Str If Call AttributeLoad NameLoad attr Str body Assign NameStore BinOpMod NameLoad Call AttributeLoad NameLoad attr Str If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str keyword SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num keyword SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num keyword SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num keyword BoolOpOr Call AttributeLoad NameLoad attr Str NameLoad keyword SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num Assign NameStore Call AttributeLoad NameLoad attr orelse Assign NameStore BinOpMod NameLoad TupleLoad NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad keyword NameLoad Assign NameStore BinOpMod Str TupleLoad SubscriptLoad NameLoad Slice Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Slice Call AttributeLoad NameLoad attr orelse Break Return Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Str Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults NameLoad body Return Call NameLoad keyword NameLoad decorator_list If CompareEq NameLoad Str body Import alias Expr Call AttributeLoad NameLoad attr
N/A N/A 
Fenced Code Extension for Python Markdown
=========================================

This extension adds Fenced Code Blocks to Python-Markdown.

    >>> import markdown
    >>> text = '''
    ... A paragraph before a fenced code block:
    ...
    ... ~~~
    ... Fenced code block
    ... ~~~
    ... '''
    >>> html = markdown.markdown(text, extensions=['fenced_code'])
    >>> html
    u'<p>A paragraph before a fenced code block:</p>\n<pre><code>Fenced code block\n</code></pre>'

Works with safe_mode also (we check this because we are using the HtmlStash):

    >>> markdown.markdown(text, extensions=['fenced_code'], safe_mode='replace')
    u'<p>A paragraph before a fenced code block:</p>\n<pre><code>Fenced code block\n</code></pre>'

Include tilde's in a code block and wrap with blank lines:

    >>> text = '''
    ... ~~~~~~~~
    ...
    ... ~~~~
    ...
    ... ~~~~~~~~'''
    >>> markdown.markdown(text, extensions=['fenced_code'])
    u'<pre><code>\n~~~~\n\n</code></pre>'

Multiple blocks and language tags:

    >>> text = '''
    ... ~~~~{.python}
    ... block one
    ... ~~~~
    ...
    ... ~~~~.html
    ... <p>block two</p>
    ... ~~~~'''
    >>> markdown.markdown(text, extensions=['fenced_code'])
    u'<pre><code class="python">block one\n</code></pre>\n\n<pre><code class="html">&lt;p&gt;block two&lt;/p&gt;\n</code></pre>'

Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/).

Project website: <http://www.freewisdom.org/project/python-markdown/Fenced__Code__Blocks>
Contact: markdown@freewisdom.org

License: BSD (see ../docs/LICENSE for details)

Dependencies:
* [Python 2.4+](http://python.org)
* [Markdown 2.0+](http://www.freewisdom.org/projects/python-markdown/)
* [Pygments (optional)](http://pygments.org)

 N/A re N/A markdown markdown.extensions.codehilite CodeHilite CodeHiliteExtension N/A FENCED_BLOCK_RE N/A N/A re compile (?P<fence>^~{3,})[ ]*(\{?\.(?P<lang>[a-zA-Z0-9_-]*)\}?)?[ ]*\n(?P<code>.*?)(?P=fence)[ ]*$ N/A N/A re MULTILINE N/A re DOTALL N/A CODE_WRAP <pre><code%s>%s</code></pre> N/A LANG_TAG  class="%s" FencedCodeExtension N/A N/A markdown Extension N/A extendMarkdown N/A N/A self md md_globals N/A N/A N/A  Add FencedBlockPreprocessor to the Markdown instance.  N/A N/A N/A md registerExtension self N/A N/A N/A N/A md preprocessors add fenced_code_block N/A FencedBlockPreprocessor md _begin N/A N/A FencedBlockPreprocessor N/A N/A N/A markdown preprocessors Preprocessor N/A __init__ N/A N/A self md N/A N/A N/A N/A N/A N/A N/A markdown preprocessors Preprocessor __init__ self md N/A N/A self checked_for_codehilite False N/A N/A self codehilite_conf N/A N/A getConfig N/A N/A self key N/A N/A N/A N/A key N/A self config N/A N/A N/A N/A N/A self config N/A key N/A 0 N/A N/A None N/A run N/A N/A self lines N/A N/A N/A  Match and store Fenced Code Blocks in the HtmlStash.  N/A N/A N/A self checked_for_codehilite N/A N/A ext N/A N/A self markdown registeredExtensions N/A N/A N/A isinstance ext CodeHiliteExtension N/A N/A N/A self codehilite_conf N/A ext config N/A N/A N/A self checked_for_codehilite True N/A text N/A N/A join lines N/A 1 N/A N/A m N/A N/A FENCED_BLOCK_RE search text N/A m N/A N/A lang N/A N/A N/A m group lang N/A N/A lang N/A LANG_TAG N/A N/A m group lang N/A N/A self codehilite_conf N/A N/A highliter N/A CodeHilite N/A N/A m group code linenos N/A N/A N/A self codehilite_conf N/A force_linenos N/A 0 css_class N/A N/A N/A self codehilite_conf N/A css_class N/A 0 style N/A N/A N/A self codehilite_conf N/A pygments_style N/A 0 lang N/A N/A N/A m group lang None noclasses N/A N/A N/A self codehilite_conf N/A noclasses N/A 0 N/A code N/A N/A highliter hilite N/A N/A code N/A CODE_WRAP N/A lang N/A N/A self _escape N/A N/A m group code N/A placeholder N/A N/A N/A N/A self markdown htmlStash store code safe True N/A text N/A %s
%s
%s N/A N/A text N/A N/A N/A m start placeholder N/A text N/A N/A N/A m end N/A N/A N/A N/A N/A text split N/A _escape N/A N/A self txt N/A N/A N/A  basic html escaping  N/A txt N/A N/A txt replace & &amp; N/A txt N/A N/A txt replace < &lt; N/A txt N/A N/A txt replace > &gt; N/A txt N/A N/A txt replace " &quot; N/A txt N/A N/A makeExtension N/A N/A configs N/A None N/A N/A N/A FencedCodeExtension configs configs N/A N/A N/A __name__ __main__ N/A N/A doctest N/A N/A N/A doctest testmod