javascript code formatter and highlighter
Solution 1
9 useful Javascript syntax highilghting scripts. There, I googled it for you. 3 of them are jQuery-based.
Solution 2
i am using codemirror.
http://codemirror.net/
its easy and cool.
Solution 3
I use Highlight.Js
Solution 4
If you want to change the syntax in a specific style or just check the style than take a look at code painter
A JavaScript beautifier that can both infer coding style and transform code to reflect that style. You can also set style preferences explicitly in a variety of ways.
Admin
Updated on June 14, 2022Comments
-
Admin almost 2 years
I am looking for a jQuery plugin that can take a string of code as input and will apply formatting and Highlights to make the code easily understandable. Just like jsfiddle.net.
As of now I have found many sites like jsbeautifier.org.. But I need a standalone jquery plugin which can process my code
Please help me on this. -
cmroanirgo over 11 yearsI got lucky and end up here ;)
-
Andrej about 11 yearsWhich of them do formatting besides highlighting?
-
Angel about 11 yearsSHJS works great :) Thank you for this link!
-
Kees C. Bakker over 10 yearsLooks cool. Haven't seen much examples though.
-
Kees C. Bakker over 10 yearsCodeMirror is very extensible. Lots of projects use it: codemirror.net/doc/realworld.html
-
vanessen about 8 yearsthis one really works well for me. I had function to remove extra tab and newlines in my pre, so the other plugin couldn't work properly because of this method. But hightlight.js work well with my function :)
-
Admin about 8 yearsFor lots of reasons the one form Google will be preferred by most: github.com/google/code-prettify
-
theEpsilon over 7 yearsit's a broken link
-
David Hedlund over 7 years@theEpsilon: Thanks, updated. Can't really say it's the exact same scripts, but the article is from 2010 and has the exact same title, so I guess it may well be. I get that link-only answers aren't ideal, but OP is asking for an external software, and those are bound to be links, and the question is from 2011, so some of them are bound to be broken.
-
Gurnard about 5 yearsbut I don't see a formatting addon. It has fantastic stuff like code completion et al but no formatting function that I can find.