diff --git a/baseweb/static/js/common.js b/baseweb/static/js/common.js index cdb8244..869dcff 100644 --- a/baseweb/static/js/common.js +++ b/baseweb/static/js/common.js @@ -1,8 +1,12 @@ -function syntaxHighlight(src, height) { +function syntaxHighlight(src, height, lang) { if(typeof src !== "string" && !(src instanceof String)) { src = JSON.stringify(src, null, 2); } - var html = hljs.highlightAuto(src).value; + if(lang) { + var html = hljs.highlight(src, {language: lang}).value; + } else { + var html = hljs.highlightAuto(src).value; + } return "
" + html + "
"; } @@ -27,4 +31,3 @@ function uuid() { return v.toString(16); }); } -