From edc540e1c22135357bb974b9fcea0ceb42492c19 Mon Sep 17 00:00:00 2001 From: BurningTreeC Date: Sat, 30 Mar 2024 19:02:12 +0100 Subject: [PATCH] switch viewFormat for output --- core/modules/widgets/view.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/view.js b/core/modules/widgets/view.js index 74d263d1613..16e0170134b 100755 --- a/core/modules/widgets/view.js +++ b/core/modules/widgets/view.js @@ -241,7 +241,18 @@ ViewWidget.prototype.refresh = function(changedTiddlers) { } else if(this.viewUpdate && this.viewWikified) { var refreshed = this.fakeWidget.refresh(changedTiddlers); if(refreshed) { - var newText = this.fakeNode.textContent; + var newText; + switch(this.viewFormat) { + case "htmlwikified": + newText = this.fakeNode.innerHTML; + break; + case "plainwikified": + newText = this.fakeNode.textContent; + break; + case "htmlencodedplainwikified": + newText = $tw.utils.htmlEncode(this.fakeNode.textContent); + break; + } if(newText !== this.text) { this.domNodes[0].textContent = newText; this.text = newText;