From 4beb1a4b334a272d59a83a8c1654ec09b2f6f834 Mon Sep 17 00:00:00 2001 From: somebody Date: Fri, 16 Dec 2022 21:49:52 -0600 Subject: [PATCH] Standardize linebreak behavior --- static/koboldai.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/static/koboldai.js b/static/koboldai.js index 748e0f95..25220c64 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -6991,4 +6991,12 @@ function showGeneratedWIData(data) { world_info_data[data.uid].manual_text = data.out; send_world_info(data.uid); } -} \ No newline at end of file +} + +$el(".gametext").addEventListener("keydown", function(event) { + if (event.key !== "Enter") return; + // execCommand is deprecated but until Firefox supports + // contentEditable="plaintext-only" we're just gonna have to roll with it + document.execCommand("insertLineBreak"); + event.preventDefault(); +}); \ No newline at end of file