Ignore lines with a " before the first = as well
This commit is contained in:
parent
5e45184480
commit
13f87fdebb
1 changed files with 3 additions and 2 deletions
|
@ -149,9 +149,10 @@ def comma_split(csstring, list=None, strip="r"):
|
|||
|
||||
def parse_attribute(line):
|
||||
"Parse a WML key-value pair from a line."
|
||||
if '=' not in line or line.find("#") > -1 and line.find("#") < line.find("="):
|
||||
return None
|
||||
where = line.find("=")
|
||||
# Ignore lines with a # or " before the first =. They're likely line continuations that won't be parsed correctly.
|
||||
if '=' not in line or -1 < line.find("#") < where or -1 < line.find("\"") < where:
|
||||
return None
|
||||
leader = line[:where]
|
||||
after = line[where+1:]
|
||||
if re.search("\s#", after):
|
||||
|
|
Loading…
Add table
Reference in a new issue