Title: [Plugin: WP SyntaxHighlighter] code collapses to one line
Last modified: August 20, 2016

---

# [Plugin: WP SyntaxHighlighter] code collapses to one line

 *  [Theo F](https://wordpress.org/support/users/theo-f/)
 * (@theo-f)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/)
 * When I insert several lines of html or css code it collapses and is shown on 
   only one (too long) line. How can I avoid/correct this?
 * [http://wordpress.org/extend/plugins/wp-syntaxhighlighter/](http://wordpress.org/extend/plugins/wp-syntaxhighlighter/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [redcocker](https://wordpress.org/support/users/redcocker/)
 * (@redcocker)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419083)
 * HI, Theo F san,
 * I have some questions.
 * 1. Let me know your OS, browser and version.
    2. Are you using “code” button 
   or “pre” button in the Visual editor? 3. Go to Settings -> WP SyntaxHighlighter
   in the setting panel, you can find the sample code in the “7. Your Current Theme”.
   Does it be shown correctly? 4. Does any code cause this issue?
 *  Thread Starter [Theo F](https://wordpress.org/support/users/theo-f/)
 * (@theo-f)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419087)
 * Hello Redcocker san,
 * I am using Windows Vista (with all updates) and browsers: IE 9.0.3, Firefox 8.0.
   
   I am using the code button and then choose either HTML of CSS (depending on the
   code that I want to insert). In the Settings panel of WP Syntaxhighlighter the
   Current Theme is showing correctly (28 lines of HTML code). I do not think that
   the code that I inserted causes this problem. It’s very basic CSS (e.g.: color
   and background-color for body-tag) or HTML code written on several lines with
   the CoffeeCup HTML-editor and then copied/pasted in the code panel of WPSyntaxHighlighter.
   The strange thing is that the problem is not consistent. While writing this reply
   I again checked what happens if I insert some CSS code with WPSyntaxHighlighter.
   I did this in the same post that I used yesterday and created just for this purpose.
   When I inserted a new bit of CSS code (before and after each example of code 
   I inserted a line of text enclosed in p-tags) not only did the new code stay 
   show on several lines (as it is supposed to be because I inserted it that way)
   but also the other bits of code in the post changed from a rendering on one line
   to a rendering on several lines. I do not understand how this can happen. I checked
   and each code-example is enclosed in the pre-tags created by WPSyntaxHighlighter
   when you use the code-button. And I did not change any settings in WPSyntaxHighlighter
   either.
 *  Plugin Author [redcocker](https://wordpress.org/support/users/redcocker/)
 * (@redcocker)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419103)
 * HI, Theo F san,
 * Thank you for your reply.
 * > When I inserted a new bit of CSS code (before and after each example of code
   > I inserted a line of text enclosed in p-tags) not only did the new code stay
   > show on several lines (as it is supposed to be because I inserted it that way)
   > but also the other bits of code in the post changed from a rendering on one
   > line to a rendering on several lines.
 * Indeed, it is strange.
 * I’ll try to find the cause of the problem.
 *  Plugin Author [redcocker](https://wordpress.org/support/users/redcocker/)
 * (@redcocker)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419153)
 * HI, Theo F san,
 * Did you get this issue when you saved your post as a draft and previewed it.
 * If you are using plugins(more than one) that covert line feed to `<br />` or 
   stop automatic formatting(wpautop), They may cause this issue after you saved
   your post as a draft.
 * e.g.
    ・[PS Disable Auto Formatting](http://wordpress.org/extend/plugins/ps-disable-auto-formatting/)・
   [brBrbr](http://camcam.info/wordpress/101)
 *  Thread Starter [Theo F](https://wordpress.org/support/users/theo-f/)
 * (@theo-f)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419160)
 * Hello Redcocker San,
 * no I did not save the post as a draft and previewed it.
 * By the way: I discovered afterwards that if I copy/paste a bit of CSS code which
   is shown on several lines by SyntaxHighlighter the code was written on one line
   by the CoffeeCup HTML editor. Do not know if this is relevant but thought I should
   mention it. Apperently it works both ways: copy/paste from HTML editor to SyntaxHighlighter
   insert-form can result in collapsing from several lines of code to one line of
   code and visa versa.
 *  Plugin Author [redcocker](https://wordpress.org/support/users/redcocker/)
 * (@redcocker)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419171)
 * Hi, Theo F san
 * `I discovered afterwards that if I copy/paste a bit of CSS code which is shown
   on several lines by SyntaxHighlighter the code was written on one line by the
   CoffeeCup HTML editor.`
 * Maybe, because CoffeeCup HTML editor supports only CR/LF.
    Wnen the code is pasted
   to Windows Notepad also, line feed will be lost.
 * I want to test with CoffeeCup HTML editor.
    Where can I get CoffeeCup HTML editor?
 * Here?
    [http://www.coffeecup.com/free-editor/](http://www.coffeecup.com/free-editor/)
 *  Thread Starter [Theo F](https://wordpress.org/support/users/theo-f/)
 * (@theo-f)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419172)
 * Hi Redcocker san,
 * yes you can find the editor there. I am using the free editor as well.
 * I will check if using Dreamweaver makes a difference.
 *  Thread Starter [Theo F](https://wordpress.org/support/users/theo-f/)
 * (@theo-f)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419173)
 * Hello Redcocker san,
 * No need to try CoffeeCup editor. The problem also happens with Dreamweaver CS5.5.
   I just now inserted two simple lines of CSS code in the SyntaxHighlighter that
   were written in Dreamweaver on two seperate lines and they collapsed to one line
   directly after using Update.
 *  Plugin Author [redcocker](https://wordpress.org/support/users/redcocker/)
 * (@redcocker)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419179)
 * Hi, Theo F san,
 * When all plugins are disabled except WP SyntaxHighligter, How does it work?
 * I think installed plugins cause this isuue.
    If you are using plugins that covert
   line feed to `<br />` or stop automatic formatting, WP SyntaxHighligter can’t
   work correctly.
 * If you are using “TinyMCE Advanced” plugin, don’t enable “Stop removing the `
   <p>` and `<br />` tags when saving and show them in the HTML editor”.
 *  Thread Starter [Theo F](https://wordpress.org/support/users/theo-f/)
 * (@theo-f)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419193)
 * Hi redcocker san,
 * I have changed this setting in Tiny and it does have the desired effect with 
   SyntaxHighlighter. I used this setting in Tiny because of other problems I had
   with posts but cannot remember what they were.
 * Thanks anyway
 * Theo
 *  Plugin Author [redcocker](https://wordpress.org/support/users/redcocker/)
 * (@redcocker)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419195)
 * Hi, Theo F san,
 * If “Stop removing the `<p>` and `<br />` tags when saving and show them in the
   HTML editor” is enabled, “TinyMCE Advanced” adds extra `<br />` into the text
   wrapped in `<pre>` tag.
 * Maybe SyntaxHighlighter Evolved works in your settings correctly, because it 
   supports not `<pre>` tag but shortcode.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘[Plugin: WP SyntaxHighlighter] code collapses to one line’ is closed 
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-syntaxhighlighter_66666c.svg)
 * [WP SyntaxHighlighter](https://wordpress.org/plugins/wp-syntaxhighlighter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-syntaxhighlighter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-syntaxhighlighter/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-syntaxhighlighter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-syntaxhighlighter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-syntaxhighlighter/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [redcocker](https://wordpress.org/support/users/redcocker/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-syntaxhighlighter-code-collapses-to-one-line/#post-2419195)
 * Status: not resolved