Why is this patch needed:

  1. 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.
  2. 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>
CommentFileSizeAuthor
#1 geshi_compliance.patch2.94 KBmilianw
geshi_compliant.patch3.35 KBmilianw

Comments

milianw’s picture

StatusFileSize
new2.94 KB

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.

moshe weitzman’s picture

Status: Needs review » Needs work

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]

milianw’s picture

Status: Needs work » Closed (won't fix)

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?

moshe weitzman’s picture

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.

milianw’s picture

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?