mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-04-10 04:36:38 +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:
parent
e145376838
commit
73491f14dd
@ -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);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user