diff --git a/editions/highlightdemo/tiddlywiki.info b/editions/highlightdemo/tiddlywiki.info index de3b00a24..3e824764b 100644 --- a/editions/highlightdemo/tiddlywiki.info +++ b/editions/highlightdemo/tiddlywiki.info @@ -11,6 +11,11 @@ ], "build": { "index": [ - "--rendertiddler","$:/core/save/all","highlightdemo.html","text/plain"] + "--rendertiddler","$:/core/save/all","highlightdemo.html","text/plain"], + "static": [ + "--rendertiddler","$:/core/templates/static.template.html","static.html","text/plain", + "--rendertiddler","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain", + "--rendertiddlers","[!is[system]]","$:/core/templates/static.tiddler.html","static","text/plain", + "--rendertiddler","$:/core/templates/static.template.css","static/static.css","text/plain"] } } diff --git a/plugins/tiddlywiki/highlight/highlightblock.js b/plugins/tiddlywiki/highlight/highlightblock.js index d1947b6a2..a2187e8d7 100644 --- a/plugins/tiddlywiki/highlight/highlightblock.js +++ b/plugins/tiddlywiki/highlight/highlightblock.js @@ -23,14 +23,14 @@ CodeBlockWidget.prototype.postRender = function() { if($tw.browser && this.document !== $tw.fakeDocument && this.language) { domNode.className = this.language.toLowerCase(); hljs.highlightBlock(domNode); - } else if(!$tw.browser && this.language && this.language.indexOf("/") == -1 ){ - try{ + } else if(!$tw.browser && this.language && this.language.indexOf("/") === -1 ){ + try { domNode.className = this.language.toLowerCase() + " hljs"; domNode.children[0].innerHTML = hljs.fixMarkup(hljs.highlight(this.language, this.getAttribute("code")).value); } catch(err) { - //can't easily tell if a language is registered or not in the packed version of hightlight.js - //so we silently fail and the codeblock remains unchanged + // Can't easily tell if a language is registered or not in the packed version of hightlight.js, + // so we silently fail and the codeblock remains unchanged } } };