Fix language detection.

This commit is contained in:
bootstraponline
2012-05-15 11:49:55 -06:00
parent fde288d9e8
commit 423b5205bf
@@ -222,8 +222,9 @@ var makePreviewHtml = function () {
var txt = codeHTML.split(/\b/);
// the syntax for code highlighting means all code, even one line, contains newlines.
if (txt.length > 1 && codeHTML.match(/\n/)) {
// txt[0] must be "`"
// txt[0] = "`"; txt[1] = "ruby"
if ($.inArray(txt[1], languages) === -1) {
if (txt[0] !== "`" || $.inArray(txt[1], languages) === -1) {
element.innerHTML = codeHTML.substring(1).trim();
hljs.highlightBlock(element, hlSpace);
continue;