I am developing a web editor for SQL, I would like to be able to style special SQL text with in text (select, create, from) differently from other texts, as a user types. Is this possible in HTML? Is there a thi开发者_运维知识库rd party libary/plugin I can use for this?
Try EditErea, it has built-it SQL highlighting support.
Formatting inside a textarea is minimal at best. You might try the approach that Stack Overflow uses, which is to let your user input in a textarea and then display another box with the input formatted. This is done at SO using Google Prettify. This includes SQL formatting as well as a list of other languages, detected and formatted automatically.
精彩评论