mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-10 07:43:49 +00:00
Fixed problem with target fields/index being erroneously applied to template
See here for discussion: https://groups.google.com/d/msg/TiddlyWiki/D3MBNhjaT3E/ph0ZuAhuPFMJ
This commit is contained in:
parent
e274a0c7d1
commit
d64590a12b
@ -40,9 +40,7 @@ exports.parse = function() {
|
|||||||
var transcludeNode = {
|
var transcludeNode = {
|
||||||
type: "element",
|
type: "element",
|
||||||
tag: "$transclude",
|
tag: "$transclude",
|
||||||
attributes: {
|
attributes: {},
|
||||||
tiddler: {type: "string", value: template || targetTitle}
|
|
||||||
},
|
|
||||||
isBlock: true
|
isBlock: true
|
||||||
};
|
};
|
||||||
var tiddlerNode = {
|
var tiddlerNode = {
|
||||||
@ -54,11 +52,16 @@ exports.parse = function() {
|
|||||||
isBlock: true,
|
isBlock: true,
|
||||||
children: [transcludeNode]
|
children: [transcludeNode]
|
||||||
};
|
};
|
||||||
if(targetField) {
|
if(template) {
|
||||||
transcludeNode.attributes.field = {type: "string", value: targetField};
|
transcludeNode.attributes.tiddler = {type: "string", value: template};
|
||||||
}
|
} else {
|
||||||
if(targetIndex) {
|
transcludeNode.attributes.tiddler = {type: "string", value: targetTitle};
|
||||||
transcludeNode.attributes.index = {type: "string", value: targetIndex};
|
if(targetField) {
|
||||||
|
transcludeNode.attributes.field = {type: "string", value: targetField};
|
||||||
|
}
|
||||||
|
if(targetIndex) {
|
||||||
|
transcludeNode.attributes.index = {type: "string", value: targetIndex};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return [tiddlerNode];
|
return [tiddlerNode];
|
||||||
};
|
};
|
||||||
|
@ -40,9 +40,8 @@ exports.parse = function() {
|
|||||||
var transcludeNode = {
|
var transcludeNode = {
|
||||||
type: "element",
|
type: "element",
|
||||||
tag: "$transclude",
|
tag: "$transclude",
|
||||||
attributes: {
|
attributes: {},
|
||||||
tiddler: {type: "string", value: template || targetTitle}
|
isBlock: true
|
||||||
}
|
|
||||||
};
|
};
|
||||||
var tiddlerNode = {
|
var tiddlerNode = {
|
||||||
type: "element",
|
type: "element",
|
||||||
@ -50,13 +49,19 @@ exports.parse = function() {
|
|||||||
attributes: {
|
attributes: {
|
||||||
tiddler: {type: "string", value: targetTitle}
|
tiddler: {type: "string", value: targetTitle}
|
||||||
},
|
},
|
||||||
|
isBlock: true,
|
||||||
children: [transcludeNode]
|
children: [transcludeNode]
|
||||||
};
|
};
|
||||||
if(targetField) {
|
if(template) {
|
||||||
transcludeNode.attributes.field = {type: "string", value: targetField};
|
transcludeNode.attributes.tiddler = {type: "string", value: template};
|
||||||
}
|
} else {
|
||||||
if(targetIndex) {
|
transcludeNode.attributes.tiddler = {type: "string", value: targetTitle};
|
||||||
transcludeNode.attributes.index = {type: "string", value: targetIndex};
|
if(targetField) {
|
||||||
|
transcludeNode.attributes.field = {type: "string", value: targetField};
|
||||||
|
}
|
||||||
|
if(targetIndex) {
|
||||||
|
transcludeNode.attributes.index = {type: "string", value: targetIndex};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return [tiddlerNode];
|
return [tiddlerNode];
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user