Closed (fixed)
Project:
Syntax Highlighter
Version:
6.x-1.26
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 May 2011 at 20:53 UTC
Updated:
19 Apr 2013 at 00:06 UTC
I've got the Syntax Highlighter working but it's still displaying everything on one line.
I've installed and enabled Wysiwyg Pre Element Fix 6.x-1.0-beta1 and Wysiwyg SyntaxHighlighter Plugin 6.x-1.2 as well as this module and the Syntax Highlighter and TinyMCE libraries. I set up Syntax Highlighter to do the languages I want and to use the
tag (default). I tried creating a unique format for it with no luck, so now I'm trying to do all this with the default Full HTML format. The filters are ordered: HTML filter Syntax highlighter Line break converter URL filter HTML corrector I addedto the HTML filter. TinyMCE 3.4.2 is the editor for the Full HTML format. I added the SyntaxHighlighter button. I turned off Remove Linebreaks. When I paste in code using the Syntax Highlighter button in TinyMCE, it initially displays all nicely indented. But when I save it, I get a single endless line. Is there anything else to try?
Comments
Comment #1
mattyoung commentedMaybe tinyMCE 3.4.2 breaks wysiwyg_syntaxhl and wysiwyg_preelementfix? preelementfix is supposed to prevent tinyMCE from removing whitespace inside pre tag. It's not working anymore for some reason. You can try asking help in wysiwyg_syntaxhl and wysiwyg_preelementfix.
I suggest you use the new 6.x-2.x-dev version. It's designed to be wysiwyg friendly. The new version does not use the {syntaxhighlighter} filter tag any more. It simply use the <pre> tag like this:
wysiwyg_syntaxhl was designed to work with the old {syntaxhighlighter} filter tag so it no longer work with this new version. You need to use the unmodified syntaxhighlighter tinyMCE plugin at http://27smiles.com/2008/04/07/tinymce-syntaxhighlighter-plugin/ or switch rich editor off to enter code.
NOTE: you must make sure your markup is proper HTML. This means if your code
have any HTML tags or entities in them, you need to change the '<' characters
to '<' (e.g. <script> to <script>), convert '&' in any HTML entity to
'&' (e.g. > to &gt;).
(if you can reproduce the previous paragraph in HTML and come out looking exactly the same, then you know what I mean :). It's this in raw HTML:
Comment #2
fizk commented