1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-27 07:43:14 +00:00

Update highlight plugin configuration to support tabs

The technique we were using to configure the library was incorrect.
This commit is contained in:
Jermolene 2014-11-06 13:27:24 +00:00
parent e145376838
commit 73491f14dd

View File

@ -14,12 +14,15 @@ Wraps up the fenced code blocks parser for highlight and use in TiddlyWiki5
var CodeBlockWidget = require("$:/core/modules/widgets/codeblock.js").codeblock;
if($tw.browser) {
var hljs = require("$:/plugins/tiddlywiki/highlight/highlight.js").hljs;
hljs.configure({tabReplace: " "});
}
CodeBlockWidget.prototype.postRender = function() {
var domNode = this.domNodes[0];
if($tw.browser && this.document !== $tw.fakeDocument && this.language) {
domNode.className = this.language.toLowerCase();
var hljs = require("$:/plugins/tiddlywiki/highlight/highlight.js").hljs;
hljs.tabReplace = " ";
hljs.highlightBlock(domNode);
}
};