From b99d1449c942286113df3c98ba7dd99137fcae64 Mon Sep 17 00:00:00 2001 From: vfbd Date: Sun, 26 Jun 2022 13:15:55 -0400 Subject: [PATCH] Remove trailing whitespace from submissions --- aiserver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aiserver.py b/aiserver.py index 69b40119..91057d5c 100644 --- a/aiserver.py +++ b/aiserver.py @@ -3495,6 +3495,7 @@ def actionsubmit(data, actionmode=0, force_submit=False, force_prompt_gen=False, if(not vars.gamestarted): vars.submission = data execute_inmod() + vars.submission = re.sub(r"[^\S\r\n]*([\r\n]*)$", r"\1", vars.submission) # Remove trailing whitespace, excluding newlines data = vars.submission if(not force_submit and len(data.strip()) == 0): assert False @@ -3553,6 +3554,7 @@ def actionsubmit(data, actionmode=0, force_submit=False, force_prompt_gen=False, data = applyinputformatting(data) vars.submission = data execute_inmod() + vars.submission = re.sub(r"[^\S\r\n]*([\r\n]*)$", r"\1", vars.submission) # Remove trailing whitespace, excluding newlines data = vars.submission # Dont append submission if it's a blank/continue action if(data != ""):