From 1d89c7925aa8392b450e7ef36c04fc3f360f9173 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 6 May 2024 15:34:42 +0100 Subject: [PATCH] Update data widget to display its content in JSON --- core/modules/widgets/data.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/data.js b/core/modules/widgets/data.js index 295404e6b4..78c6bff348 100644 --- a/core/modules/widgets/data.js +++ b/core/modules/widgets/data.js @@ -31,7 +31,10 @@ DataWidget.prototype.render = function(parent,nextSibling) { this.parentDomNode = parent; this.computeAttributes(); this.execute(); - this.renderChildren(parent,nextSibling); + var jsonPayload = JSON.stringify(this.readDataTiddlerValues(),null,4); + var textNode = this.document.createTextNode(jsonPayload); + parent.insertBefore(textNode,nextSibling); + this.domNodes.push(textNode); }; /*