mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-26 04:04:45 +00:00
Added support for macros
And added a dummy version macro to get started
This commit is contained in:
@@ -26,7 +26,8 @@ Text nodes are:
|
||||
/*global require: false, exports: false */
|
||||
"use strict";
|
||||
|
||||
var wikiTextRules = require("./WikiTextRules.js").wikiTextRules,
|
||||
var wikiTextMacros = require("./WikiTextMacros.js"),
|
||||
wikiTextRules = require("./WikiTextRules.js").wikiTextRules,
|
||||
utils = require("./Utils.js"),
|
||||
util = require("util");
|
||||
|
||||
@@ -91,12 +92,16 @@ WikiTextParser.prototype.renderAsHtml = function(store,title) {
|
||||
case "img":
|
||||
renderElement(tree[t],true); // Self closing elements
|
||||
break;
|
||||
case "macro":
|
||||
renderSubTree(tree[t].output);
|
||||
break;
|
||||
default:
|
||||
renderElement(tree[t]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
wikiTextMacros.executeMacros(this.tree,this.store);
|
||||
renderSubTree(this.tree);
|
||||
return output.join("");
|
||||
};
|
||||
@@ -117,6 +122,9 @@ WikiTextParser.prototype.renderAsText = function(store,title) {
|
||||
output.push(tree[t].value);
|
||||
}
|
||||
break;
|
||||
case "macro":
|
||||
renderSubTree(tree[t].output);
|
||||
break;
|
||||
}
|
||||
if(tree[t].children) {
|
||||
renderSubTree(tree[t].children);
|
||||
|
||||
Reference in New Issue
Block a user