Remove trailing whitespace from submissions
This commit is contained in:
parent
151407a001
commit
b99d1449c9
|
@ -3495,6 +3495,7 @@ def actionsubmit(data, actionmode=0, force_submit=False, force_prompt_gen=False,
|
||||||
if(not vars.gamestarted):
|
if(not vars.gamestarted):
|
||||||
vars.submission = data
|
vars.submission = data
|
||||||
execute_inmod()
|
execute_inmod()
|
||||||
|
vars.submission = re.sub(r"[^\S\r\n]*([\r\n]*)$", r"\1", vars.submission) # Remove trailing whitespace, excluding newlines
|
||||||
data = vars.submission
|
data = vars.submission
|
||||||
if(not force_submit and len(data.strip()) == 0):
|
if(not force_submit and len(data.strip()) == 0):
|
||||||
assert False
|
assert False
|
||||||
|
@ -3553,6 +3554,7 @@ def actionsubmit(data, actionmode=0, force_submit=False, force_prompt_gen=False,
|
||||||
data = applyinputformatting(data)
|
data = applyinputformatting(data)
|
||||||
vars.submission = data
|
vars.submission = data
|
||||||
execute_inmod()
|
execute_inmod()
|
||||||
|
vars.submission = re.sub(r"[^\S\r\n]*([\r\n]*)$", r"\1", vars.submission) # Remove trailing whitespace, excluding newlines
|
||||||
data = vars.submission
|
data = vars.submission
|
||||||
# Dont append submission if it's a blank/continue action
|
# Dont append submission if it's a blank/continue action
|
||||||
if(data != ""):
|
if(data != ""):
|
||||||
|
|
Loading…
Reference in New Issue