开发者

Format special text with in a HTML textarea

开发者 https://www.devze.com 2023-04-10 08:09 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消