Skip to content

Commit

Permalink
Update data widget to display its content in JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Jermolene committed May 6, 2024
1 parent e378c6c commit 1d89c79
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/modules/widgets/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

/*
Expand Down

0 comments on commit 1d89c79

Please sign in to comment.