Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highlighting Sql code in text area [closed]

I have a textarea in which I have to show some sql commands.I don't want to present it as a normal text to user,I have to format it as SQL(as in management studio).Is there any opensource library (Javascript) out there that can help me achieve my goal? I am currently using c# as backend.

like image 648
ArunKumar Avatar asked Dec 04 '25 21:12

ArunKumar


1 Answers

As you say you're using a TextArea, that means that the user can edit the content of it, then i recommend you to use a web code editor plugin like Ace Editor or Code Mirror (both implemented in frontend).

If the user doesn't need to edit that code and only need to read it, then you can highlight the snippet using a Syntax highlighting plugin like Prism.js (there are more plugins like that out there).

All of them support highlight for SQL and a lot of programming languages.

like image 100
Carlos Delgado Avatar answered Dec 06 '25 10:12

Carlos Delgado



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!