GeSHi support
milianw - February 11, 2008 - 22:56
| Project: | Markdown with SmartyPants |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | milianw |
| Status: | won't fix |
Description
Why is this patch needed:
- Because GeSHi does some preparation and wraps its code blocks in a square bracket notation, markdown sees it as a simple paragraph. Thus stuff inside gets escaped etc.
- To call the GeSHi filter before marksmarty is not a solution, because code blocks generated by markdown won't get GeSHi features then.
So when activating the GeSHi support, one should call Markdown before GeSHi to get this:
a generic markdown code block
with linenumbers thanks to GeSHi
this is plaintext mode
<blockcode type="php">
$syntax_highlighting = true;
</blockcode>
<blockcode>
this codeblock is in plaintext mode,
just like the generic markdown code block!
</blockcode>| Attachment | Size |
|---|---|
| geshi_compliant.patch | 3.35 KB |

#1
I've made some change to my patch. The "geshi compliant" option is gone, I call
filter_list_format($format)now to check this on the fly.I wonder wether an additional note should be shown to the user, that geshi should be rearranged so that it is called after marksmarty?
New patch is attached.
#2
This patch is quite ugly with its conditionals strewn about. I really don't likemingling filter code like this. GeSHI before markdown looks fine to me. In this case, simply don't use the markdown code block feature. It really doesn't do anything for you that you can't do with a [code] tag or with [blockcode]
#3
Ok, so I don't have a chance to include this into trunk. A pity.
What about a Readme/Faq entry that GeSHi must be called before markdown. Where would be the correct position for this?
#4
I added a note to the project page for markdown. The project page of GeSHi says that it has code to help with "filter conflict". Not sure what thats about.
#5
I'll ask the GeSHi guys if this could be implemented. Is "won't fix" the correct status for this? Or should it be closed?