mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-25 21:32:50 +00:00
fixes of a newbie, me
This commit is contained in:
parent
c5035fc0b0
commit
426f2978cf
@ -49,8 +49,8 @@ exports.parse = function() {
|
|||||||
type: "element",
|
type: "element",
|
||||||
tag: "$codeblock",
|
tag: "$codeblock",
|
||||||
attributes: {
|
attributes: {
|
||||||
code: {tye: "string", value: text},
|
code: {type: "string", value: text},
|
||||||
language: {tye: "string", value: this.match[1]}
|
language: {type: "string", value: this.match[1]}
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
@ -31,7 +31,7 @@ CodeBlockWidget.prototype.render = function(parent,nextSibling) {
|
|||||||
this.computeAttributes();
|
this.computeAttributes();
|
||||||
this.execute();
|
this.execute();
|
||||||
var codeNode = this.document.createElement("code");
|
var codeNode = this.document.createElement("code");
|
||||||
if (this.getAttribute("language")) {
|
if(this.getAttribute("language")) {
|
||||||
codeNode.setAttribute("class",this.getAttribute("language"));
|
codeNode.setAttribute("class",this.getAttribute("language"));
|
||||||
}
|
}
|
||||||
var domNode = this.document.createElement("pre");
|
var domNode = this.document.createElement("pre");
|
||||||
|
@ -10,4 +10,4 @@ To add the plugin to your own TiddlyWiki5, just drag this link to the browser wi
|
|||||||
|
|
||||||
To add your prefered [[theme|http://highlightjs.org/static/test.html]] append to your:
|
To add your prefered [[theme|http://highlightjs.org/static/test.html]] append to your:
|
||||||
|
|
||||||
[[$:/boot/boot.css]]
|
[[$:/tags/stylesheet]]
|
||||||
|
@ -19,7 +19,7 @@ Wraps up the fenced code blocks parser for highlight and use in TiddlyWiki5
|
|||||||
lang = this.domNodes[0].getElementsByTagName('code')[0].className,
|
lang = this.domNodes[0].getElementsByTagName('code')[0].className,
|
||||||
hljs = require("$:/plugins/tiddlywiki/highlight/highlight.js").hljs;
|
hljs = require("$:/plugins/tiddlywiki/highlight/highlight.js").hljs;
|
||||||
|
|
||||||
if ($tw.browser && lang !== 'no-highlight') {
|
if($tw.browser && lang !== 'no-highlight') {
|
||||||
hljs.tabReplace = ' ';
|
hljs.tabReplace = ' ';
|
||||||
hljs.highlightBlock(this.domNodes[0]);
|
hljs.highlightBlock(this.domNodes[0]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user