mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +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",
|
||||
tag: "$codeblock",
|
||||
attributes: {
|
||||
code: {tye: "string", value: text},
|
||||
language: {tye: "string", value: this.match[1]}
|
||||
code: {type: "string", value: text},
|
||||
language: {type: "string", value: this.match[1]}
|
||||
}
|
||||
}];
|
||||
};
|
||||
|
@ -31,7 +31,7 @@ CodeBlockWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.computeAttributes();
|
||||
this.execute();
|
||||
var codeNode = this.document.createElement("code");
|
||||
if (this.getAttribute("language")) {
|
||||
if(this.getAttribute("language")) {
|
||||
codeNode.setAttribute("class",this.getAttribute("language"));
|
||||
}
|
||||
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:
|
||||
|
||||
[[$:/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,
|
||||
hljs = require("$:/plugins/tiddlywiki/highlight/highlight.js").hljs;
|
||||
|
||||
if ($tw.browser && lang !== 'no-highlight') {
|
||||
if($tw.browser && lang !== 'no-highlight') {
|
||||
hljs.tabReplace = ' ';
|
||||
hljs.highlightBlock(this.domNodes[0]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user