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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With