Login or register Large RSS Icon

Fenced Code Blocks

Summary

An extension to Python-Markdown that adds an alternate code block syntax that address a few issues with indented code blocks.

Get the Code

The code is currently available in the Python-Markdown Git repository and may be included in a future release.

Dependencies

Syntax

As this is a new syntax for the markdown community at large, the exact syntax is still slightly in flux. Therefore, while the basic example below should continue to work, see the source (with comments and doc tests) for additional specifics.

A simple example (taken from PHP Markdown Extra's docs):

This is a paragraph introducing:

~~~~~~~~~~~~~~~~~~~~~
a one-line code block
~~~~~~~~~~~~~~~~~~~~~
Powered by Sputnik | XHTML 1.1