Surely I must be doing something wrong since no one has complained about this yet.

I use the following input filters (first to last):
HTML filter, Line break converter, GeSHi filter, BBCode

When HTML filter is off it works fine but when I enable it the output turns into a gray mess.
HTML filter is set to escape all tags and GeSHi uses code tags in square brackets [code], [php], [html], etc.

Thanks

CommentFileSizeAuthor
#2 geshi_bug.gif14.42 KBaccount-deletion-needed

Comments

soxofaan’s picture

I can't reproduce with HTMLfilter + LineBreakConverter + GeSHi.
I didn't try with BBCode yet, maybe that's the culprit?

Which type of GeSHi tags do you use? angle brackets (<foo>) or square brackets ([foo])?

Can you give a screenshot or a source view of the gray mess?

account-deletion-needed’s picture

StatusFileSize
new14.42 KB

I disabled BBCode but the problem remains. Using only [foo] tags.
In the attachment is a screenshot of HTML filter on and HTML filter off.

Here's the code GeSHi outputs when HTML filter is on:
<span class="geshifilter"><code class="geshifilter-php">&amp;<span style="color: #808080; font-style: italic;">#10;&amp;lt;div class=&amp;quot;links&amp;quot;&amp;gt;&amp;#10; &nbsp; &nbsp;&amp;lt;?php print $links ?&amp;gt;&amp;#10; &nbsp; &nbsp;&amp;lt;?php if (((strcasecmp($node-&amp;gt;type, &amp;#039;book&amp;#039;) == 0) || (strcasecmp($node-&amp;gt;type, &amp;#039;forum&amp;#039;) == 0) || (strcasecmp($node-&amp;gt;type, &amp;#039;story&amp;#039;) == 0))&amp;#10; &nbsp; &nbsp; &nbsp;&amp;amp;&amp;amp; (strcasecmp(drupal_get_path_alias($_GET[&amp;#039;q&amp;#039;]), &amp;#039;node&amp;#039;) != 0)): ?&amp;gt;&amp;#10; &nbsp; &nbsp;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&amp;#10; &nbsp; &nbsp; &nbsp;addthis_url = location.href; &nbsp; &amp;#10; &nbsp; &nbsp; &nbsp;addthis_title = document.title; &nbsp;&amp;#10; &nbsp; &nbsp; &nbsp;addthis_pub = &amp;#039;tagbytag&amp;#039;; &nbsp; &nbsp; &amp;#10; &nbsp; &nbsp;&amp;lt;/script&amp;gt;&amp;#10; &nbsp; &nbsp;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://s7.addthis.com/js/addthis_widget.php?v=12&amp;quot; &amp;gt;&amp;lt;/script&amp;gt;&amp;#10; &nbsp; &nbsp;&amp;lt;?php endif; ?&amp;gt;&amp;#10; &nbsp;&amp;lt;/div&amp;gt;&amp;#10;</span>

And when it's off:

<div class="geshifilter">
<div class="geshifilter-php" style="font-family: monospace;">
<ol>
<li style="font-family: monospace; font-weight: normal;">
<div style="font-family: monospace; font-weight: normal; font-style: normal">&lt;div <span style="color: #000000; font-weight: bold;">class</span>=<span style="color: #ff0000;">&quot;links&quot;</span>&gt;</div>

</li>
<li style="font-family: monospace; font-weight: normal;">
<div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">print</span> <span style="color: #0000ff;">$links</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div>
</li>
<li style="font-family: monospace; font-weight: normal;">
<div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066;">strcasecmp</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$node</span>-&gt;<span style="color: #006600;">type</span>, <span style="color: #ff0000;">'book'</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> || <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">strcasecmp</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$node</span>-&gt;<span style="color: #006600;">type</span>, <span style="color: #ff0000;">'forum'</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> || <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">strcasecmp</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$node</span>-&gt;<span style="color: #006600;">type</span>, <span style="color: #ff0000;">'story'</span><span style="color: #66cc66;">&#41;</span> == <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></div>

</li>
<li style="font-family: monospace; font-weight: normal;">
<div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; &nbsp; &nbsp; &amp;&amp; <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">strcasecmp</span><span style="color: #66cc66;">&#40;</span>drupal_get_path_alias<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_GET</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'q'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">'node'</span><span style="color: #66cc66;">&#41;</span> != <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>: <span style="color: #000000; font-weight: bold;">?&gt;</span></div>

</li>
<li style="font-family: monospace; font-weight: normal;">
<div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; &nbsp; &lt;script type=<span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</div>
</li>
<li style="font-family: monospace; font-weight: normal;">
<div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; &nbsp; &nbsp; addthis_url = location.href; &nbsp; </div>
</li>
<li style="font-family: monospace; font-weight: normal;">

<div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; &nbsp; &nbsp; addthis_title = document.title; &nbsp;</div>
</li>
<li style="font-family: monospace; font-weight: normal;">
<div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; &nbsp; &nbsp; addthis_pub = <span style="color: #ff0000;">'tagbytag'</span>; &nbsp; &nbsp; </div>
</li>

<li style="font-family: monospace; font-weight: normal;">
<div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></div>
</li>
<li style="font-family: monospace; font-weight: normal;">
<div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; &nbsp; &lt;script type=<span style="color: #ff0000;">&quot;text/javascript&quot;</span> src=<span style="color: #ff0000;">&quot;http://s7.addthis.com/js/addthis_widget.php?v=12&quot;</span> &gt;&lt;/script&gt;</div>

</li>
<li style="font-family: monospace; font-weight: normal;">
<div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></div>
</li>
<li style="font-family: monospace; font-weight: normal;">
<div style="font-family: monospace; font-weight: normal; font-style: normal">&nbsp; &lt;/div&gt;</div>
</li>
</ol>

</div>
</div>
soxofaan’s picture

Assigned: Unassigned » soxofaan
Category: support » bug

I found the problem: you've probably set up the html filter to "Escape all tags" instead of "Strip disallowed tags".
Is there any particular reason for that?

I don't think there is a clean way of making GeSHi filter coexist with the tag escaping of html filter.
Moreover I think it doesn't make much sense to have tag escaping when you already have geshi filter, which is more powerful than the simple tag escaping.

I should add detection for this conflict to the geshi filter conflict page.

account-deletion-needed’s picture

Thanks that solved the problem!

account-deletion-needed’s picture

Status: Active » Fixed
soxofaan’s picture

Title: HTML filter breaks highlighting » conflict with html filter if it is setup to escape all tags
Version: 5.x-2.5 » 5.x-2.x-dev
Category: bug » feature
Status: Fixed » Active

see #3

soxofaan’s picture

Version: 5.x-2.x-dev » 6.x-1.x-dev
Status: Active » Patch (to be ported)

fixed for 5.x-2.x-dev by http://drupal.org/cvs?commit=98566

soxofaan’s picture

Status: Patch (to be ported) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.