Skip to content

Commit 12390f8

Browse files
committed
fix: prefix list, must be an array
1 parent 30ad711 commit 12390f8

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

xmlua/document.lua

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,8 @@ end
177177

178178

179179
do -- C14N methods
180-
-- list can be a string (space separated), an array of strings, or nil
181180
local function create_xml_string_array(list)
182-
local list = list or {}
183-
184-
if type(list) == "string" then
185-
-- list is a string, assume it is the space separated PrefixList attribute, split it
186-
local list_str = list
187-
list = {}
188-
list_str:gsub("([^%s]+)", function(cap) list[#list+1] = cap end)
189-
end
190-
191-
if #list == 0 then
181+
if list == nil or #list == 0 then
192182
return nil
193183
end
194184

@@ -320,7 +310,7 @@ do -- C14N methods
320310
-- array, which canonicalizes the entire document.
321311
-- @tparam[opt] table opts options table with the following fields:
322312
-- @tparam[opt="C14N_EXCLUSIVE_1_0"] string|number opts.mode any of C14N_1_0, C14N_EXCLUSIVE_1_0, C14N_1_1
323-
-- @tparam[opt] array|string opts.inclusive_ns_prefixes array, or space-separated string, of namespace prefixes to include
313+
-- @tparam[opt] array opts.inclusive_ns_prefixes array of namespace prefixes to include
324314
-- @tparam[opt=false] boolean with_comments if truthy, comments will be included
325315
-- @return string containing canonicalized XML, or throws an error if it fails
326316
function methods:canonicalize(select, opts)

0 commit comments

Comments
 (0)