1
0
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:
João Bolila 2014-01-12 17:09:24 +00:00
parent c5035fc0b0
commit 426f2978cf
4 changed files with 5 additions and 5 deletions

View File

@ -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]}
} }
}]; }];
}; };

View File

@ -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");

View File

@ -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]]

View File

@ -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]);
} }