Skip to content

Commit

Permalink
Fix wmlparser3 considers "_" part of attribute value
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LovCAPONE committed Feb 11, 2019
1 parent de87a85 commit b3b4f97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/tools/wesnoth/wmlparser3.py
Expand Up @@ -519,7 +519,7 @@ def parse_outside_strings(self, line):
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
Expand Down

0 comments on commit b3b4f97

Please sign in to comment.