Okay, "FIXED" is a bit of an over-statement; the plugin did exactly as it was supposed to, it called PHP's
nl2br() function on all input prior to output. Unfortunately, that's not always the desired result, so I've made it "smarter", not exactly "fixed" it...
With help from some members on the SitePoint forums, I've modified the serendipity_event_plugin_nl2br to work with HTML
textarea,
pre, and the BBCode
GeSHi modifiers so that those ugly
<br /> tags aren't added when they aren't wanted.
The updates are now live on this site, so I don't have to go back and update anything. Cool!
Here's what I did:
- Open up
pluginsserendipity_event_nl2brserendipity_event_nl2br.php in your serendipity folder
- add two new functions (within the class, but order of where they go is unimportant, I placed them before the
event_hook function) as shown below:
- find the following line in the event_hook function:
$eventData[$element] = nl2br($eventData[$element]); and replace it with the following:
That should be it. (YAY, I can finally post code snippets now!) I eventually plan on updating this a bit more to allow for user submitted tags to be ignored by the nl2br function within this event. Any help on that would be appreciated since I don't entirely understand the plugin system, even after speed-reading through the example documentation.
Posted by Brendon Kozlowski