javascript - How to color keywords with HTML? -
i'm developing sql-based webapp , need color keyworkds, such select, in, update, delete, from, , on, notepad++, sublime, etc..
does have idea on how javascript?
i thinking running async task on every keystroke, have nooo idea on how that...
per https://code.google.com/p/google-code-prettify/wiki/gettingstarted add
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?lang=sql"></script>
to <head>
, put
<pre class="prettyprint lang-sql">...</pre>
around html-escaped sql.
http://google-code-prettify.googlecode.com/svn/trunk/tests/prettify_test.html#sql_lang shows sql highlighting in action.
Comments
Post a Comment