Skip to content

Commit 818ea43

Browse files
committed
Merge pull request #7 from Leorex/master
Fix to handle hex numeric XML entities
2 parents 05871cf + a0825c3 commit 818ea43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

slaxml.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function SLAXML:parse(xml,options)
5454
local nsStack = {}
5555

5656
local entityMap = { ["lt"]="<", ["gt"]=">", ["amp"]="&", ["quot"]='"', ["apos"]="'" }
57-
local entitySwap = function(orig,n,s) return entityMap[s] or n=="#" and char(s) or orig end
57+
local entitySwap = function(orig,n,s) return entityMap[s] or n=="#" and char('0'..s) or orig end
5858
local function unescape(str) return gsub( str, '(&(#?)([%d%a]+);)', entitySwap ) end
5959
local anyElement = false
6060

0 commit comments

Comments
 (0)