Allowing some formatting in comments

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
destraynor

Allowing some formatting in comments

Post by destraynor »

Hi all,
We use and recommend serendipity at Planet Minds and it works very well. A question that keeps occurring is How can we put formatting in comments?

Basically the problem is due to the technical nature of many of the blogs, people like to be able to post code examples as comments. However code such as ...

Code: Select all

int x= 9;
int y= 234;
int z=0;
 while(x*x<y-21)
 { 
  z+=x;
 }
System.out.println("z = " + z);
turns into ...

Code: Select all

int x= 9; int y= 234; int z=0;  while(x*x<y-21)  {     z+=x;  } System.out.println("z = " + z);

Does anyone have any suggestions as to what we can do ?

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

Re: Allowing some formatting in comments

Post by garvinhicking »

There are a couple of markup formatting plugins; one of them is the "Geshi" Code highlighter, which does this code highliting. Another one is the BBCode plugin, which allows for \

Code: Select all

....\[code] markup. All those formatting plugins can be enabled to be available for comments.

Personally I suggest using the BBCode plugin, this is the most well known plugin. If you need advanced programming highlighting and markup, the Geshi plugin is the way to go.

HTH and have fun with Serendipity,
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/
destraynor

Thanks

Post by destraynor »

Thanks Marvin , Geshi sounds ideal.
Post Reply