I was just wondering how “stackoverflow” beautify submitted code.
I searched the web and also found the way to beautify the code.
But main problem is: When I put description of my problem and code-snippet.
At that point how we Highlight the code-snippet only but not the description of the problem.
I use some of the CSS from the link but did not find the answer.
http://lifehacker.biz/articles/web-developers-package-code-beautifier-and-formatter/
UPDATED-
In my problem whole question(description + code-snippet) is present in a column of the database. It comes by a Struts2 tag , So at that point how I distinguish the code-snippet part and the description part to apply the the code beautifier.
how stack overflow does it is: you have to indent the text by 4 spaces.
You could use <code> tag in HTML to specify which part is code and run the plugin only
or beautifier is whatever plugin you are using
Try chilli for example: http://noteslog.com/chili/
Basically use code tags to specify what is code and what’s note. Chilli does it pretty easily.