preserve spaces inside parentheses for arg
During testing, I found that spaces inside quotes were preserved by the "instring" code, but not spaces inside naked parentheses. For example, "(Elvish Rider)" would be turned into "ElvishRider". This fix keeps interior whitespace from being discarded; the problem of leading and trailing whitespace is dealt with by stripping the arg before appending it to args.
This commit is contained in:
parent
7a014e8030
commit
f2391f0966
1 changed files with 2 additions and 2 deletions
|
@ -173,9 +173,9 @@ def parse_macroref(start, line):
|
|||
line[i].isspace() and \
|
||||
brackdepth == 1 and \
|
||||
parendepth == 0:
|
||||
args.append(arg)
|
||||
args.append(arg.strip())
|
||||
arg = ""
|
||||
elif not line[i].isspace():
|
||||
elif not line[i].isspace() or parendepth > 0:
|
||||
arg += line[i]
|
||||
return (args, brackdepth, parendepth)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue