mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-07-09 13:22:46 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f76ec0b2c6 | |||
| 69005a904d | |||
| ed33625407 | |||
| f848d8c368 | |||
| 729d4b6374 |
@@ -61,7 +61,7 @@ LogWidget.prototype.log = function() {
|
|||||||
$tw.utils.each(this.parseTreeNode.attributes,function(attribute,name) {
|
$tw.utils.each(this.parseTreeNode.attributes,function(attribute,name) {
|
||||||
if(name.substring(0,2) !== "$$") {
|
if(name.substring(0,2) !== "$$") {
|
||||||
var resultList = self.computeAttribute(attribute,{asList: true});
|
var resultList = self.computeAttribute(attribute,{asList: true});
|
||||||
if(resultList.length <= 1) {
|
if(resultList && resultList.length <= 1) {
|
||||||
data[name] = resultList[0] || "";
|
data[name] = resultList[0] || "";
|
||||||
} else {
|
} else {
|
||||||
data[name] = resultList;
|
data[name] = resultList;
|
||||||
@@ -75,7 +75,7 @@ LogWidget.prototype.log = function() {
|
|||||||
allVars[v] = variable.value;
|
allVars[v] = variable.value;
|
||||||
} else {
|
} else {
|
||||||
var variableInfo = this.getVariableInfo(v);
|
var variableInfo = this.getVariableInfo(v);
|
||||||
allVars[v] = variableInfo.resultList.length > 1 ? variableInfo.resultList : variableInfo.text;
|
allVars[v] = variableInfo && variableInfo.resultList && variableInfo.resultList.length > 1 ? variableInfo.resultList : variableInfo.text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(this.filter) {
|
if(this.filter) {
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ Widget.prototype.getVariableInfo = function(name,options) {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
text: text,
|
text: text,
|
||||||
resultList: [text]
|
resultList: text === undefined ? text : [text]
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ Widget.prototype.makeFakeWidgetWithVariables = function(vars = {}) {
|
|||||||
const value = vars[name];
|
const value = vars[name];
|
||||||
return Array.isArray(value)
|
return Array.isArray(value)
|
||||||
? { text: value[0], resultList: value }
|
? { text: value[0], resultList: value }
|
||||||
: { text: value, resultList: [value] };
|
: { text: value, resultList: value === undefined ? value : [value] };
|
||||||
}
|
}
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
opts.variables = Object.assign({}, vars, opts.variables || {});
|
opts.variables = Object.assign({}, vars, opts.variables || {});
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
title: Transclude/MissingTiddlerAttributeVariable
|
||||||
|
description: Missing Tiddler Attribute Variable
|
||||||
|
type: text/vnd.tiddlywiki-multiple
|
||||||
|
tags: [[$:/tags/wiki-test-spec]]
|
||||||
|
|
||||||
|
title: Output
|
||||||
|
description: hello
|
||||||
|
|
||||||
|
<$transclude tiddler=<<nonExistentVariable>> field="description"/>
|
||||||
|
+
|
||||||
|
title: ExpectedResult
|
||||||
|
|
||||||
|
<p>hello</p>
|
||||||
Reference in New Issue
Block a user