Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

formatting sourcecode using jQuery

Does anyone know if there's a jQuery plugin to format code, XML or HTML?

I'm showing the user some code on an html page. I use google prettify for coloring the syntax, but would like some indentation and linebreaks too. any suggestions?

like image 529
Sorskoot Avatar asked Dec 28 '25 16:12

Sorskoot


2 Answers

Here http://www.webdesignbooth.com/9-useful-javascript-syntax-highlighting-scripts/ the "beautyOfCode" is mentioned as jquery plugin.

Have a look also at Syntax highlighting code with Javascript

like image 175
migajek Avatar answered Dec 31 '25 18:12

migajek


I made jQuery.Syntax : http://www.oriontransfer.co.nz/software/jquery-syntax

It integrates very well with jQuery, especially if you are doing dynamic formatting. Have a look at this example : http://www.syntax-highlighting.com/

I'm probably biased but I'd say its pretty good and easy to use.

like image 23
ioquatix Avatar answered Dec 31 '25 17:12

ioquatix



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!