I am using the Syntax Highlighter module as well as WYSIWYG filter in my text format, and finding that the classes that Syntax Highlighter interpret are being stripped because they contain a colon. For instance:

<pre class="brush:php">
<?php
  print 'Hello world!';
?>
</pre>

After saving the node and then editing, the 'brush:php' class is being stripped because of the colon it contains. Any way to stop this from happening?

Proposed resolution

Use the alternative syntax described on the Syntax Highlighter project page. The example using <pre> above should look like this:

{syntaxhighlighter class="brush:php"}
<?php
  print 'Hello world!';
?>
{/syntaxhighlighter}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jdjeet’s picture

Hi,
I guess you might have forget to keep the right order.
You need to follow the order of input format filters as described on syntax highlighter module.
As mentioned there, syntax highlighter comes after any and all filters that can modify content input.

Try this.

vinmassaro’s picture

Actually, this is not the case. Syntax highlighter filter is always last - it's the WYSIWYG Filter stripping out the 'brush: php' class. Disabling the syntax highlighter filter shows the WYSIWYG Filter still removes the 'brush: php' class.

Renee S’s picture

Version: 7.x-1.6-rc2 » 7.x-1.x-dev

Any luck with this?

vinmassaro’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
2.13 KB

Here is a patch to wysiwyg_filter.pages.inc which disables class name cleanup if brush: is found. This allows the Syntax Highlighter class to be applied correctly.

gisle’s picture

Component: Code » Miscellaneous
Category: Bug report » Feature request
Issue summary: View changes
Status: Needs review » Fixed

I think this is a feature request (not a bug report), and it is now resolved in the Syntax Highlighter project. See updated issue summary.

geek-merlin’s picture

Thanx @gisle for clarifying and documenting this. Yes, so fixed.

Status: Fixed » Closed (fixed)

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