publishing programming code

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
toncho11
Regular
Posts: 12
Joined: Thu Jan 17, 2008 10:58 am

publishing programming code

Post by toncho11 »

I want to publish some code on my blog to show it to other people.
I user the "pre" tag, but I get too many new rows. It is because serendipity replaces all new rows in my post with br tag or whatever. How could I disable this for a single post?

10x,
Anton
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: publishing programming code

Post by yellowled »

toncho11 wrote:I want to publish some code on my blog to show it to other people. I user the "pre" tag, but I get too many new rows. It is because serendipity replaces all new rows in my post with br tag or whatever.
Might be or probably is. You might want to take a look at the Geshi plugin.

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: publishing programming code

Post by garvinhicking »

Hi!

The nl2br plugin does that. Since serendipity 1.2 you can configure that event plugin to exclude certain html tags, like <pre>, if you want.

Regards,
Garvin
# 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/
toncho11
Regular
Posts: 12
Joined: Thu Jan 17, 2008 10:58 am

Post by toncho11 »

I used the nl2br plugin to remove the <br>s and geshi plugin:

[geshi lang=csharp]
code
[/geshi]

and it worked.
Post Reply