summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/luaxml/luaxml-domobject.lua
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/generic/luaxml/luaxml-domobject.lua')
-rw-r--r--macros/luatex/generic/luaxml/luaxml-domobject.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/macros/luatex/generic/luaxml/luaxml-domobject.lua b/macros/luatex/generic/luaxml/luaxml-domobject.lua
index 19850ce456..7829c13b1e 100644
--- a/macros/luatex/generic/luaxml/luaxml-domobject.lua
+++ b/macros/luatex/generic/luaxml/luaxml-domobject.lua
@@ -67,6 +67,9 @@ local function serialize_dom(parser, current,level, output)
for k, v in pairs(attr) do
t[#t+1] = string.format("%s='%s'", k, escape_attr(v))
end
+ -- sort attributes alphabetically. this will ensure that
+ -- their order will not change between several executions of dom:serialize()
+ table.sort(t)
if #t == 0 then return "" end
-- add space before attributes
return " " .. table.concat(t, " ")