From 423b5205bf4e57ffda7e92fd165ded8958060447 Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Tue, 15 May 2012 11:49:55 -0600 Subject: [PATCH] Fix language detection. --- lib/gollum/frontend/public/gollum/livepreview/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/gollum/frontend/public/gollum/livepreview/index.html b/lib/gollum/frontend/public/gollum/livepreview/index.html index 069d6b9c..637710ab 100644 --- a/lib/gollum/frontend/public/gollum/livepreview/index.html +++ b/lib/gollum/frontend/public/gollum/livepreview/index.html @@ -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;