From 32ad83df8ee7254a7ce6fb77512e59dc752a14b2 Mon Sep 17 00:00:00 2001 From: somebody Date: Sat, 30 Jul 2022 15:05:54 -0500 Subject: [PATCH] Fix arbitrary newline insertion when token streaming is enabled In adventure mode with token streaming enabled, retrying after an action would cause a
element to be inserted into the action. This prevents the insertion of the
if token streaming is enabled. --- static/application.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/application.js b/static/application.js index 7475fea2..551dd1c0 100644 --- a/static/application.js +++ b/static/application.js @@ -2351,7 +2351,12 @@ $(document).ready(function(){ var element = game_text.children('#n' + index); if(element.length) { unbindGametext(); - if((element[0].nextSibling === null || element[0].nextSibling.nodeType !== 1 || element[0].nextSibling.tagName !== "CHUNK") && element[0].previousSibling !== null && element[0].previousSibling.tagName === "CHUNK") { + if( + (element[0].nextSibling === null || element[0].nextSibling.nodeType !== 1 || element[0].nextSibling.tagName !== "CHUNK") + && element[0].previousSibling !== null + && element[0].previousSibling.tagName === "CHUNK" + && !$("#setoutputstreaming")[0].checked + ) { element[0].previousSibling.appendChild(document.createElement("br")); } element.remove(); // Remove the chunk