From a302be82d00f77ec272f5966396a70b6f84c3a3a Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 11 Apr 2012 11:29:26 +0100 Subject: [PATCH] Use stringified fields where possible in the view macro --- js/macros/view.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/macros/view.js b/js/macros/view.js index a60a421f1..bcb50aa32 100644 --- a/js/macros/view.js +++ b/js/macros/view.js @@ -87,7 +87,15 @@ exports.macro = { } break; default: // "text" - return [Renderer.TextNode(value)]; + // Get the stringified version of the field value + if(field !== "text" && tiddler) { + value = tiddler.getFieldString(field) + } + if(value === undefined || value === null) { + return []; + } else { + return [Renderer.TextNode(value)]; + } } return []; }