From c428cad2864ce258303030d49b37d7da4aa88695 Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Fri, 11 May 2012 15:05:05 -0600 Subject: [PATCH] Remove marker on no highlight pre tags. --- lib/gollum/frontend/public/gollum/livepreview/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/gollum/frontend/public/gollum/livepreview/index.html b/lib/gollum/frontend/public/gollum/livepreview/index.html index 756a87b4..f002a2c1 100644 --- a/lib/gollum/frontend/public/gollum/livepreview/index.html +++ b/lib/gollum/frontend/public/gollum/livepreview/index.html @@ -223,13 +223,18 @@ var makePreviewHtml = function () { // the syntax for code highlighting means all code, even one line, contains newlines. if (txt.length > 1 && codeHTML.match(/\n/)) { // txt[0] = "`"; txt[1] = "ruby" - if ($.inArray(txt[1], languages) === -1) continue; + if ($.inArray(txt[1], languages) === -1) { + element.innerHTML = codeHTML.substring(1).trim(); + element.className = "nohighlight"; + continue; + } element.className = txt[1] + " highlight"; // length + 1 for the marker character. element.innerHTML = codeHTML.substring(txt[1].length+1).trim(); hljs.highlightBlock(element, " "); } else { + element.innerHTML = codeHTML.substring(1).trim(); element.className = "nohighlight"; } }