Syntax highlighter stops working as it was working before, tested all configuration settings

CommentFileSizeAuthor
#4 syntaxhighlighterissue.txt918.58 KBaxxint

Comments

mattyoung’s picture

What does it do now? What does it show? Plain text? Nothing?

axxint’s picture

I'm seeing the same thing. I've gone through all my settings and everything looks configured right, but code is showing up plain inside the following kinds of tags {syntaxhighlighter brush: csharp;fontsize: 100; first-line: 1; } ... {/syntaxhighlighter}

Everything was working a day ago, and while I have been working on the site, I don't believe anyone installed any modules or messed with any global settings. The syntax highlight button is still in my TinyMCE editor, and I can use it, but the output isn't rendering.

mattyoung’s picture

what's the page source look like?

axxint’s picture

StatusFileSize
new918.58 KB

I pasted below everything that looked relevant, but also attached a txt file of the whole page source.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
 <head>
...
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/libraries/syntaxhighlighter_3.0.83/styles/shCore.css?F" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/libraries/syntaxhighlighter_3.0.83/styles/shThemeDefault.css?F" />
...
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/wysiwyg/editors/css/tinymce-3.css?F" />
...
<script type="text/javascript" src="/sites/all/libraries/tinymce/jscripts/tiny_mce/tiny_mce.js?F"></script>
...
<!--//--><![CDATA[//><!--
...
 "syntaxhighlighter": null, "wysiwyg": { "configs": { "tinymce": { "format1": { "button_tile_map": true, "document_base_url": "/", "mode": "none", "plugins": "table,-syntaxhl", "theme": "advanced", "width": "100%", "strict_loading_mode": true, "convert_urls": false,
...
"theme_advanced_buttons1": "bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,outdent,indent,undo,redo,link,unlink,image,fontselect,fontsizeselect,styleselect,tablecontrols,syntaxhl", "theme_advanced_buttons2": "", "theme_advanced_buttons3": "" }, "format2": { "button_tile_map": true, "document_base_url": "/", "mode": "none", "plugins": "table,-syntaxhl,-break", "theme": "advanced", "width": "100%", "strict_loading_mode": true, "convert_urls": false,
...
 "plugins": { "format1": { "native": { "syntaxhl": "/sites/all/modules/wysiwyg_syntaxhl/tinymce/syntaxhl/editor_plugin.js" }, "drupal": [  ] }, "format2": { "native": { "syntaxhl": "/sites/all/modules/wysiwyg_syntaxhl/tinymce/syntaxhl/editor_plugin.js" }
jQuery.extend(Drupal.settings, 
...
//--><!]]>
</script>
 </head>
<body id="home">
...
<div class="entry">
<p>{syntaxhighlighter brush: ruby;fontsize: 100; first-line: 1; }a = [ 45, 3, 19, 8 ] b = [ 'sam', 'max', 56, 98.9, 3, 10, 'jill' ] print (a + b).join(' '), "\n" print a[2], " ", b[4], " ", b[-2], "\n" print a.sort.join(' '), "\n" a &lt;&lt; 57 &lt;&lt; 9 &lt;&lt; 'phil' print "A: ", a.join(' '), "\n"{/syntaxhighlighter}</p>
</div>
...
</body>
</html>

However, in TinyMCE in drupal in the HTML view the syntaxhighlighter code looks like this:

<pre class="wysiwyg-syntaxhl brush: ruby;fontsize: 100; first-line: 1; ">a = [ 45, 3, 19, 8 ] b = [ 'sam', 'max', 56, 98.9, 3, 10, 'jill' ] print (a + b).join(' '), "\n" print a[2], " ", b[4], " ", b[-2], "\n" print a.sort.join(' '), "\n" a &lt;&lt; 57 &lt;&lt; 9 &lt;&lt; 'phil' print "A: ", a.join(' '), "\n"</pre>

The input format is Full HTML and I don't have any filters enabled for that format. I even unchecked everything in the "cleanup & output" section of my WYSIWYG Full HTML TinyMCE profile for good measure too.

mattyoung’s picture

>The input format is Full HTML and I don't have any filters enabled for that format.

Since you are using the "Full HTML" format and do not have the "Syntax highlighter" filter enable, then you can just change the markup from:

{syntaxhighlighter brush: ruby;fontsize: 100; first-line: 1; }a = [ 45, 3, 19, 8 ] b = [ 'sam', 'max', 56, 98.9, 3, 10, 'jill' ] print (a + b).join(' '), "\n" print a[2], " ", b[4], " ", b[-2], "\n" print a.sort.join(' '), "\n" a &lt;&lt; 57 &lt;&lt; 9 &lt;&lt; 'phil' print "A: ", a.join(' '), "\n"{/syntaxhighlighter}

to

<pre brush: ruby;fontsize: 100; first-line: 1; }a = [ 45, 3, 19, 8 ] b = [ 'sam', 'max', 56, 98.9, 3, 10, 'jill' ] print (a + b).join(' '), "\n" print a[2], " ", b[4], " ", b[-2], "\n" print a.sort.join(' '), "\n" a &lt;&lt; 57 &lt;&lt; 9 &lt;&lt; 'phil' print "A: ", a.join(' '), "\n"
</pre>

EDIT: you need to enable the "Syntax highlighter" filter if you want to use the filter format:

{syntaxhighlighter brush: ruby}
...
{/syntaxhighlighter}

the purpose of the "Syntax highlighter" filter is so that you can use it in some restricted format like "Filtered HTML" so that untrusted user can have syntax highlight code in their post (e.g. in comments posted by anonymous users).

axxint’s picture

Syntax highlighter filter was enabled for both full and filtered.

Outsource dev team fixed it somehow. If they let us know what they did, I'll post it.

Thank you!

mattyoung’s picture

Status: Active » Closed (works as designed)