
python-markdown2 - issue #1
patch from Adam Gomaa to add syntax highlighting and footnote support
Adam Gomaa sent me this patch (see my email). Look into adding it (by default off, with options to turn this syntax on)... if possible. I haven't looked at the patch yet.
Comment #1
Posted on Sep 27, 2007 by Happy DogThere was a bug in my code; I didn't notice that it double-escaped the output when doing syntax highlighting. This is the updated patch which fixes that; it only escapes the code if it doesn't go through Pygments.
Comment #2
Posted on Oct 18, 2007 by Grumpy Rhinorevision 54 adds footnotes support. Adam, I've changed what you've given me a little bit. I hope the format of the generated HTML doesn't cause problems for your usage. I do intend to provide an easy way to tweak that output with subclassing (easier that overriding the _add_footnotes() method, at least.
Comment #3
Posted on Nov 8, 2007 by Grumpy RhinoThe pygments-based syntax highlighting is in. However, I'm not sure I love the Markdown syntax to indicate the language. I plan to bring it up on the markdown-discuss list for discussion.
Comment #4
Posted on Feb 13, 2008 by Grumpy RhinoA nicer way to determine the language might be having the first line of the codeblock contain a comment, in the language the codeblock represents, with nothing but the name in it.
for example:
Python
REM BASIC
You could maybe add a few funny characters inside the comment just to make sure there are no accidents. This would make the markdown source actually readable in plain text form, without worrying about readers accidentally thinking :::python is part of the code.
Comment #5
Posted on Feb 13, 2008 by Grumpy RhinoNot bad.
For comparison Google Code's wiki syntax for code markup is this:
{{{ code here }}}
and you can indicate the language like this (I believe):
{{{{Python} print "hi" }}}
That works fairly naturally.
For the markup that doesn't identify a language I think it is doing some kind of guessing. I don't know how that works, tho.
Anyway, just for comparison.
Comment #6
Posted on Feb 21, 2008 by Grumpy RhinoIs it actually guessing in python-markdown2? From the docs, it looks like you might have to do the guessing yourself using guess_lexer:
Status: Accepted
Labels:
Type-Enhancement
Priority-Medium