Standardize linebreak behavior

This commit is contained in:
somebody
2022-12-16 21:49:52 -06:00
parent df23399a4a
commit 4beb1a4b33

View File

@@ -6992,3 +6992,11 @@ function showGeneratedWIData(data) {
send_world_info(data.uid);
}
}
$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();
});