Highlighting syntax in a html text editor
All,
In a html textarea is it possible to 开发者_如何学Gohightlight c and cpp syntax.If do please indicated an example code for it.
int main()
Int should be highlighted in this case since it is a keyword.
http://www.cdolivet.com/index.php?page=editArea&sess=ba6469857a2ab4dacc7dc4a7b65545f5 and http://codepress.sourceforge.net/ are two very good options. I'm a fan of the first, but it's more work to set up.
you would need a scripting language (like PHP or JavaScript) to parse the text in the textarea and surround the keywords with a tag such as word . Then in your css you can add a style for class keyword
Try Ace Editor!
Support over 110 languages
精彩评论