Add SQL support

This commit is contained in:
Amrit Panesar committed 2017-03-14 17:05:41 -07:00
1 parent 4ee14a1ab2
commit b6bc5af534
3 files changed
+8

No files matched your search

+1
View File
@@ -24,6 +24,7 @@
<li id="xml_tab"><a href="#">XML</a></li>
<li id="js_tab"><a href="#">JavaScript</a></li>
<li id="css_tab"><a href="#">CSS</a></li>
<li id="sql_tab"><a href="#">SQL</a></li>
</ul>
</div><!-- /.nav-collapse -->
</div><!-- /.container -->
+6
View File
@@ -31,6 +31,9 @@ var beautify_html = require('js-beautify').html;
// xml-beautify library
var beautify_xml = require('xml-beautifier');
// sql-formatter library
var beautify_sql = require('sql-formatter');
$('window').ready(function () {
@@ -51,6 +54,7 @@ $('window').ready(function () {
case 'json':
case 'js':
case 'css':
case 'sql':
$('#navbar').find('>ul>li.active').removeClass('active');
$('#'+type+'_tab').addClass('active');
@@ -96,6 +100,8 @@ $('window').ready(function () {
case 'css':
stringOut = hljs.highlightAuto(beautify_css(stringIn)).value;
break;
case 'sql':
stringOut = hljs.highlightAuto(beautify_sql.format(stringIn)).value;
}
} catch (e) {
stringOut = 'Error: Unable to parse ' + type + '<br>' + e;
+1
View File
@@ -24,6 +24,7 @@
"htmllint": "^0.6.0",
"jquery": "^3.1.1",
"js-beautify": "^1.6.11",
"sql-formatter": "^1.2.0",
"uglifyify": "^3.0.4",
"xml-beautifier": "^0.3.0"
},