Lots of <br />s when using syntax highlight plugins.

Creating and modifying plugins.
Post Reply
Posts: 1
Joined: Wed Jul 11, 2007 3:09 am

Lots of <br />s when using syntax highlight plugins.

Post by anakin » Wed Jul 11, 2007 6:22 pm

I have setup a Serendipity blog on my gentoo server yesterday and intended to record some of my ideas and codes. After everything seems to be fine, I went to find syntax highlight plugins in order to make articles and source codes easier for reading.

Since now, I have tried Geshi, BBcode, and Serendipity dp.SyntaxHighlighter Plugin written by Brendon Kozlowski, but all of them have the html symbol <br /> included at the end of line. I even disabled WYSIWYG editor, but the problem remained.

Can anyone please be so kind to tell me what's wrong with my blog? I really appreciated.

User avatar
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Re: Lots of <br />s when using syntax highlight plugin

Post by garvinhicking » Wed Jul 11, 2007 7:02 pm


Actually what is causing this '<br>' is the "NL2BR" markup plugin by s9y. It converts your linebreaks to br's. So either you completely remove that plugin (or disable it for entries where you post sourcecode, by using the 'Extended properties for entries plugin'), or make sure you place the nl2br plugin AFTER the sourcecode highlighting plugin.

Also you might want to remove the 's9ymarkup' event plugin since together with Sourcecode postings this might format unwanted things.

# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

User avatar
Posts: 37
Joined: Mon Oct 25, 2004 11:54 pm

Post by gizmola » Sun Jul 15, 2007 10:12 pm

As always Garv is right, however, you can still use the nl2br plugin with the Geshi plugin for example, but the Geshi plugin must come before th nl2br plugin in order. Serendipity calls the plugins in the order in which they appear, and if nl2br operates before Geshi gets it, then it will already have inserted a bunch of br tags into your source.

Post Reply