diff options
Diffstat (limited to 'markdown/extensions/fenced_code.py')
-rw-r--r-- | markdown/extensions/fenced_code.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/markdown/extensions/fenced_code.py b/markdown/extensions/fenced_code.py index e5b3350..87cdfc8 100644 --- a/markdown/extensions/fenced_code.py +++ b/markdown/extensions/fenced_code.py @@ -49,6 +49,8 @@ Language tags: <pre><code class="python"># Some python code </code></pre> +Optionally backticks instead of tildes as per how github's code block markdown is identified. + Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/). Project website: <http://www.freewisdom.org/project/python-markdown/Fenced__Code__Blocks> @@ -69,7 +71,7 @@ from markdown.extensions.codehilite import CodeHilite, CodeHiliteExtension # Global vars FENCED_BLOCK_RE = re.compile( \ - r'(?P<fence>^~{3,})[ ]*(\{?\.(?P<lang>[a-zA-Z0-9_-]*)\}?)?[ ]*\n(?P<code>.*?)(?P=fence)[ ]*$', + r'(?P<fence>^(?:~{3,}|`{3,}))[ ]*(\{?\.(?P<lang>[a-zA-Z0-9_-]*)\}?)?[ ]*\n(?P<code>.*?)(?P=fence)[ ]*$', re.MULTILINE|re.DOTALL ) CODE_WRAP = '<pre><code%s>%s</code></pre>' |