Are there any JavaScript live syntax highlighters? -
i've found syntax highlighters highlight pre-existing code, i'd type wysiwyg-style editor. don't need auto-completed functions, highlighting.
as follow-up question, wysiwyg editor stackoverflow uses?
edit: answer below, found 2 might suit needs: editarea , codepress
edit: see question also:
https://stackoverflow.com/questions/379185/free-syntax-highlighting-editor-control-in-javascript
here interesting article how write one: (even better, gives full source javascript formatter , colorizer.)
implementing syntax-higlighting javascript editor in javascript or brutal odyssey dark side of dom tree
how 1 decent syntax highlighting? simple scanning can tell difference between strings, comments, keywords, , other code. time wanted able recognize regular expressions, didn't have blatant incorrect behaviour anymore.
importantly, handles regex correctly. of interest used continuation passing style lexer/parser instead of more typical lex (or regex) based lexers you'll see in wild.
as bonus discusses lot of real-world issues you'll run when working javascript in browser.
Comments
Post a Comment