mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-05-06 21:51:31 +00:00
Compare commits
5 Commits
bidirectio
...
further-mv
| 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) {
|
||||
if(name.substring(0,2) !== "$$") {
|
||||
var resultList = self.computeAttribute(attribute,{asList: true});
|
||||
if(resultList.length <= 1) {
|
||||
if(resultList && resultList.length <= 1) {
|
||||
data[name] = resultList[0] || "";
|
||||
} else {
|
||||
data[name] = resultList;
|
||||
@@ -75,7 +75,7 @@ LogWidget.prototype.log = function() {
|
||||
allVars[v] = variable.value;
|
||||
} else {
|
||||
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) {
|
||||
|
||||
@@ -189,7 +189,7 @@ Widget.prototype.getVariableInfo = function(name,options) {
|
||||
}
|
||||
return {
|
||||
text: text,
|
||||
resultList: [text]
|
||||
resultList: text === undefined ? text : [text]
|
||||
};
|
||||
};
|
||||
|
||||
@@ -338,7 +338,7 @@ Widget.prototype.makeFakeWidgetWithVariables = function(vars = {}) {
|
||||
const value = vars[name];
|
||||
return Array.isArray(value)
|
||||
? { text: value[0], resultList: value }
|
||||
: { text: value, resultList: [value] };
|
||||
: { text: value, resultList: value === undefined ? value : [value] };
|
||||
}
|
||||
opts = opts || {};
|
||||
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