Skip to content

Commit

Permalink
Updated mdx_code to allow {2,} at signs for code syntax highlighting …
Browse files Browse the repository at this point in the history
…instead of mandating two. The quantity of opening and closing @ signs must match.

Change inspired by mdx_fenced_code.py, at Python Markdown.
http://gitorious.org/projects/python-markdown/repos/mainline/blobs/master/mdx_fenced_code.py
  • Loading branch information
lethain committed Jul 8, 2008
1 parent c6ef191 commit 5f124ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion markdown/mdx_code.py
Expand Up @@ -16,7 +16,7 @@ def extendMarkdown(self, md, md_global):
md.textPreprocessors.insert(0, preprocessor)


CODE_BLOCK_REGEX = re.compile(r"\r?\n(?P<spaces>[ ]*)@@[ ]*(?P<syntax>[a-zA-Z0-9_+-]+)[ ]*(?P<linenos>[a-zA-Z]*)[ ]*\r?\n(?P<code>.*?)@@[ ]*\r?\n", re.DOTALL | re.MULTILINE)
CODE_BLOCK_REGEX = re.compile(r"\r?\n(?P<spaces>[ ]*)(?P<fence>^@{2,})[[ ]*(?P<syntax>[a-zA-Z0-9_+-]+)[ ]*(?P<linenos>[a-zA-Z]*)[ ]*\r?\n(?P<code>.*?)(?P=fence)[ ]*\r?\n", re.DOTALL | re.MULTILINE)

class CodeBlockPreprocessor :
def run (self, text):
Expand Down

0 comments on commit 5f124ad

Please sign in to comment.