Teach wmlindent about <<lua strings>>.
This commit is contained in:
parent
137b5b0ffb
commit
f676484395
1 changed files with 9 additions and 1 deletions
|
@ -112,6 +112,7 @@ class bailout:
|
|||
def reindent(name, infp, outfp):
|
||||
"Reindent WML."
|
||||
dostrip = True
|
||||
in_lua = False
|
||||
seen_wml = False
|
||||
inmacro = False
|
||||
ignoring = False
|
||||
|
@ -204,7 +205,14 @@ def reindent(name, infp, outfp):
|
|||
eligible = transformed.split("#")[0]
|
||||
else:
|
||||
eligible = transformed
|
||||
if eligible.count('"') % 2:
|
||||
if dostrip and "<<" in eligible and not ">>" in eligible.split("<<",1)[1]:
|
||||
dostrip = False
|
||||
in_lua = True
|
||||
elif in_lua:
|
||||
if ">>" in eligible and not "<<" in eligible.split(">>",1)[1]:
|
||||
dostrip = True
|
||||
in_lua = False
|
||||
elif eligible.count('"') % 2:
|
||||
dostrip = not dostrip
|
||||
# Are we going to be immediately following a tag?
|
||||
if opener(transformed) or closer(transformed):
|
||||
|
|
Loading…
Add table
Reference in a new issue