prevented tabs, vert tabs, line feeds and carriage returns.
This commit is contained in:
parent
c8c10f16f6
commit
0f78499f70
|
@ -10,7 +10,7 @@
|
|||
## system you're running it on. Or, feel free to sign up for a free
|
||||
## rawtext.club account and help us build this and other tools!
|
||||
##
|
||||
## created originall by cmccabe@tilde.town - spring 2018-ish.
|
||||
## created originally by cmccabe@tilde.town - spring 2018-ish.
|
||||
## ported from asciimatics to python curses late 2019.
|
||||
##
|
||||
## WHAT?
|
||||
|
@ -221,6 +221,8 @@ def validate_car(car):
|
|||
for idx,row in enumerate(car):
|
||||
if len(row) > max_x+1: ## check length of each row in .choochoo file.
|
||||
return 0 ## train car too long; skip it.
|
||||
elif "\t" in row or "\v" in row or "\f" in row or "\r" in row:
|
||||
return 0 # skip if contains tabs, vert tabs, line feeds or carriage ret
|
||||
elif len(row) < longest_line:
|
||||
padding = " "*(longest_line - len(row))
|
||||
car[idx] += padding ## add padding spaces.
|
||||
|
|
Loading…
Reference in New Issue