mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-26 17:06:51 +00:00
Stop the view macro returning extraneous elements
This commit is contained in:
parent
9247bb0186
commit
199d2acb5a
@ -52,7 +52,7 @@ exports.executeMacro = function() {
|
|||||||
switch(this.params.format) {
|
switch(this.params.format) {
|
||||||
case "link":
|
case "link":
|
||||||
if(value === undefined) {
|
if(value === undefined) {
|
||||||
return $tw.Tree.Element("span",{},[]);
|
return null;
|
||||||
} else {
|
} else {
|
||||||
var link = $tw.Tree.Macro("link",{
|
var link = $tw.Tree.Macro("link",{
|
||||||
srcParams: {to: value},
|
srcParams: {to: value},
|
||||||
@ -85,7 +85,7 @@ exports.executeMacro = function() {
|
|||||||
case "date":
|
case "date":
|
||||||
var template = this.params.template || "DD MMM YYYY";
|
var template = this.params.template || "DD MMM YYYY";
|
||||||
if(value === undefined) {
|
if(value === undefined) {
|
||||||
return $tw.Tree.Element("span",{},[]);
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return $tw.Tree.Text($tw.utils.formatDateString(value,template));
|
return $tw.Tree.Text($tw.utils.formatDateString(value,template));
|
||||||
}
|
}
|
||||||
@ -96,12 +96,12 @@ exports.executeMacro = function() {
|
|||||||
value = tiddler.getFieldString(field);
|
value = tiddler.getFieldString(field);
|
||||||
}
|
}
|
||||||
if(value === undefined || value === null) {
|
if(value === undefined || value === null) {
|
||||||
return $tw.Tree.Element("span",{},[]);
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return $tw.Tree.Text(value);
|
return $tw.Tree.Text(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $tw.Tree.Element("span",{},[]);
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user