Skip to content

Commit

Permalink
fix: do not reset origin attr if not offer valid attr
Browse files Browse the repository at this point in the history
  • Loading branch information
Crazyokd committed Feb 24, 2025
1 parent a5bf67e commit ebc0ce1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion luaxml.lua
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,9 @@ function luaxml:set(path, val, attr)
end
end

obj["@attr"] = attr
if attr then
obj["@attr"] = attr
end
-- neither a map nor an array
if not obj["@head"] and #obj == 0 then
obj["@val"] = val
Expand Down

0 comments on commit ebc0ce1

Please sign in to comment.