Skip to content

Commit 4bb31f0

Browse files
committed
fix(inputters): Discard duplicate values being parsed without keys in XML
1 parent 67ea929 commit 4bb31f0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

inputters/xml.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ inputter._name = "xml"
77
inputter.order = 2
88

99
local function startcommand (parser, command, options)
10+
-- Discard list values (non-key/value), stuffed by LXP/expat to make it possible to deduce the order of keys in
11+
-- the source. We're not using it, so we don't care and it is clutter in the AST that makes it different from
12+
-- ASTs generated from SIL inputs.
13+
for i = 1, #options do
14+
options[i] = nil
15+
end
1016
local stack = parser:getcallbacks().stack
1117
local lno, col, pos = parser:pos()
1218
local position = { lno = lno, col = col, pos = pos }

0 commit comments

Comments
 (0)