mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Render command: fix bug with multiple variable usage
This commit is contained in:
parent
a38dc17300
commit
8aad7b00ab
@ -38,15 +38,15 @@ Command.prototype.execute = function() {
|
|||||||
type = this.params[2] || "text/html",
|
type = this.params[2] || "text/html",
|
||||||
template = this.params[3],
|
template = this.params[3],
|
||||||
variableList = this.params.slice(4),
|
variableList = this.params.slice(4),
|
||||||
tiddlers = wiki.filterTiddlers(tiddlerFilter);
|
tiddlers = wiki.filterTiddlers(tiddlerFilter),
|
||||||
$tw.utils.each(tiddlers,function(title) {
|
variables = Object.create(null);
|
||||||
var parser = wiki.parseTiddler(template || title),
|
|
||||||
variables = {currentTiddler: title};
|
|
||||||
while(variableList.length >= 2) {
|
while(variableList.length >= 2) {
|
||||||
variables[variableList[0]] = variableList[1];
|
variables[variableList[0]] = variableList[1];
|
||||||
variableList = variableList.slice(2);
|
variableList = variableList.slice(2);
|
||||||
}
|
}
|
||||||
var widgetNode = wiki.makeWidget(parser,{variables: variables}),
|
$tw.utils.each(tiddlers,function(title) {
|
||||||
|
var parser = wiki.parseTiddler(template || title);
|
||||||
|
var widgetNode = wiki.makeWidget(parser,{variables: $tw.utils.extend({},variables,{currentTiddler: title})}),
|
||||||
container = $tw.fakeDocument.createElement("div");
|
container = $tw.fakeDocument.createElement("div");
|
||||||
widgetNode.render(container,null);
|
widgetNode.render(container,null);
|
||||||
var text = type === "text/html" ? container.innerHTML : container.textContent,
|
var text = type === "text/html" ? container.innerHTML : container.textContent,
|
||||||
|
Loading…
Reference in New Issue
Block a user