I would like to allow my visitors to post source code, highlighted with geshi filter.

Of course I also need to filter malicious HTML code, so I must enable HTML filter too.

This should not be a problem, I first use HTML filter, and then geshifilter.

Still, the result from code like:

[code lang="c"]
int main() {
}
[/code]

becomes

amp#10;int main() {amp#10;}amp#10;

where amp is a real ampersand

If the HTML filter is switched off, it geshifilter works flawless.
Using HTML filter after geshifilter is obviously wrong.
Drupal version 6.2.

Comments

sibidiba’s picture

Project: GeSHi Filter for syntax highlighting » Drupal core
Version: 6.x-1.1 » 6.2
Component: Code » filter.module

I guess because HTML filter comes first, this is a bug in HTML filter.

So HTML filter in Drupal 6.2 filters too much. It is not possible to leave or even [code] blocks untouched.

sibidiba’s picture

It seems to me, the problem is, that HTML filter must come obviously before geshi filter.

But HTML filter filters out " and translates it into " so [code lang="c"] becomes [code lang=AMPquot;cAMPquot;] not a good input for geshifilter.

AMP is an ampersand. Why does not HTML filter leaves these tags untouched?

soxofaan’s picture

Project: Drupal core » GeSHi Filter for syntax highlighting
Version: 6.2 » 6.x-1.1
Component: filter.module » User interface
Category: bug » support
Priority: Critical » Normal

I can't reproduce the issue, as far as I understand your description

in any case it is indeed advised to put GeSHi filter after the HTML filter

soxofaan’s picture

Also note that GeShi filter uses a prepare/preprocess pass, which comes before the HTML filter,
more info at http://drupal.org/node/272435#comment-887869

boombatower’s picture

Status: Active » Closed (cannot reproduce)

Please reopen if still relevant.