kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Fixed problem with target fields/index being erroneously applied to template
See here for discussion: https://groups.google.com/d/msg/TiddlyWiki/D3MBNhjaT3E/ph0ZuAhuPFMJprint-window-tiddler
rodzic
e274a0c7d1
commit
d64590a12b
|
@ -40,9 +40,7 @@ exports.parse = function() {
|
|||
var transcludeNode = {
|
||||
type: "element",
|
||||
tag: "$transclude",
|
||||
attributes: {
|
||||
tiddler: {type: "string", value: template || targetTitle}
|
||||
},
|
||||
attributes: {},
|
||||
isBlock: true
|
||||
};
|
||||
var tiddlerNode = {
|
||||
|
@ -54,11 +52,16 @@ exports.parse = function() {
|
|||
isBlock: true,
|
||||
children: [transcludeNode]
|
||||
};
|
||||
if(targetField) {
|
||||
transcludeNode.attributes.field = {type: "string", value: targetField};
|
||||
}
|
||||
if(targetIndex) {
|
||||
transcludeNode.attributes.index = {type: "string", value: targetIndex};
|
||||
if(template) {
|
||||
transcludeNode.attributes.tiddler = {type: "string", value: template};
|
||||
} else {
|
||||
transcludeNode.attributes.tiddler = {type: "string", value: targetTitle};
|
||||
if(targetField) {
|
||||
transcludeNode.attributes.field = {type: "string", value: targetField};
|
||||
}
|
||||
if(targetIndex) {
|
||||
transcludeNode.attributes.index = {type: "string", value: targetIndex};
|
||||
}
|
||||
}
|
||||
return [tiddlerNode];
|
||||
};
|
||||
|
|
|
@ -40,9 +40,8 @@ exports.parse = function() {
|
|||
var transcludeNode = {
|
||||
type: "element",
|
||||
tag: "$transclude",
|
||||
attributes: {
|
||||
tiddler: {type: "string", value: template || targetTitle}
|
||||
}
|
||||
attributes: {},
|
||||
isBlock: true
|
||||
};
|
||||
var tiddlerNode = {
|
||||
type: "element",
|
||||
|
@ -50,13 +49,19 @@ exports.parse = function() {
|
|||
attributes: {
|
||||
tiddler: {type: "string", value: targetTitle}
|
||||
},
|
||||
isBlock: true,
|
||||
children: [transcludeNode]
|
||||
};
|
||||
if(targetField) {
|
||||
transcludeNode.attributes.field = {type: "string", value: targetField};
|
||||
}
|
||||
if(targetIndex) {
|
||||
transcludeNode.attributes.index = {type: "string", value: targetIndex};
|
||||
if(template) {
|
||||
transcludeNode.attributes.tiddler = {type: "string", value: template};
|
||||
} else {
|
||||
transcludeNode.attributes.tiddler = {type: "string", value: targetTitle};
|
||||
if(targetField) {
|
||||
transcludeNode.attributes.field = {type: "string", value: targetField};
|
||||
}
|
||||
if(targetIndex) {
|
||||
transcludeNode.attributes.index = {type: "string", value: targetIndex};
|
||||
}
|
||||
}
|
||||
return [tiddlerNode];
|
||||
};
|
||||
|
|
Ładowanie…
Reference in New Issue