Fix wmlparser3 considers "_" part of attribute value

The wml parser, when parsing the outside of a string that is
translatable, only assumed “spaces” characters could precede it. If
there are “tabs” characters the code parses the “_” character as an
attribute value.

The solution is to add a stripping code for “tabs” characters.

Code style updated based on recommendations from ProditorMagnus.
This commit is contained in:
Lovens Weche 2019-02-05 21:48:54 -05:00
parent de87a856e9
commit b3b4f97cf1

View file

@ -519,7 +519,7 @@ class Parser:
self.handle_attribute(line)
else:
for i, segment in enumerate(line.split(b"+")):
segment = segment.lstrip(b" ")
segment = segment.lstrip(b" \t")
if i > 0:
# If the last segment is empty (there was a plus sign