Support » Plugin: WP SyntaxHighlighter » [Plugin: WP SyntaxHighlighter] Not wrapping lines & requires core edit

  • Resolved djeyewater

    (@djeyewater)


    I am using the default WordPress twentyeleven theme with no other plugins activated. For highlighting the code, I am using the <pre class="brush: code"> format.

    At first the plugin didn’t work at all, eventually I found this was because wordpress was stripping the classname from the pre tag. So you need to edit kses.php to allow adding a class to pre. I didn’t see this mentioned in the installation instructions, though maybe I missed it. I think that having to edit the wordpress core files is generally frowned upon though.

    The other problem is that, now I have the plugin working, it is not wrapping long lines. Instead it gets a horizontal scrollbar. The line has plenty of spaces in it where it can wrap, so I’m not sure why it won’t wrap?

    http://wordpress.org/extend/plugins/wp-syntaxhighlighter/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author redcocker

    (@redcocker)

    Hi, djeyewater san

    >So you need to edit kses.php to allow adding a class to pre.

    This plugin is designed with consideration for KSES filter.
    It adds some tags and attributes to KSES as allowed tags and attributes automatically.

    Did you esit a post as a registerd user belongs to Administrators or Editors?

    >it is not wrapping long lines.

    Go to setting panel.
    Change “Library version” to 2.1.382.
    And enable “Wrap lines”.

    Thread Starter djeyewater

    (@djeyewater)

    Hi

    User is an Administrator. I did some googling, and maybe the problem is because I am using WordPress multisite: http://danielbachhuber.com/2010/09/09/disabling-htmlkses-filtering-in-wordpress-multisite/. I have now installed the plugin from there, and undid the changes I made to kses.php, and now wordpress does not strip the class tag from pre.

    I made the changes for long lines you suggested, and it is now wrapping nicely.

    Thanks for the plugin and your help!

    Cheers

    Dave

    This works great for me, nice work. I was using SyntaxHiglighter compressed before and it generates this horizontal scroll bar which I detest. after so much search, I came across this and it is really working fines. I like the way it wraps the long code lines and the feature to copy to clipboard without first highlighting the code. You can see a live example here: http://www.cynamix.net/2207/how-to-add-pagination-numbered-navigation-to-blogger-blog-blogspot.html

    Great job guys!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP SyntaxHighlighter] Not wrapping lines & requires core edit’ is closed to new replies.