summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/lxml-ent.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-01-29 16:15:09 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-01-29 16:15:09 +0100
commit452587cdeefbf6e3bf1eee91e4e976f1135b785f (patch)
treee52f05dfd327c3b31a1b0fb82545dbdec639d2e2 /tex/context/base/mkiv/lxml-ent.lua
parent975f4f9f2d71d8021900955404f8b144ca6895f5 (diff)
downloadcontext-452587cdeefbf6e3bf1eee91e4e976f1135b785f.tar.gz
2016-01-28 22:37:00
Diffstat (limited to 'tex/context/base/mkiv/lxml-ent.lua')
-rw-r--r--tex/context/base/mkiv/lxml-ent.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/lxml-ent.lua b/tex/context/base/mkiv/lxml-ent.lua
index a5c5bc389..c392713f0 100644
--- a/tex/context/base/mkiv/lxml-ent.lua
+++ b/tex/context/base/mkiv/lxml-ent.lua
@@ -10,6 +10,7 @@ local type, next, tonumber = type, next, tonumber
local byte, format = string.byte, string.format
local utfchar = utf.char
local lpegmatch = lpeg.match
+local setmetatableindex = table.setmetatableindex
--[[ldx--
<p>We provide (at least here) two entity handlers. The more extensive
@@ -41,17 +42,25 @@ end
if characters and characters.entities then
+ -- the big entity table also has amp, quot, apos, lt, gt in them
+
+ local loaded = false
+
function characters.registerentities(forcecopy)
+ if loaded then
+ return
+ end
if forcecopy then
- table.setmetatableindex(entities,nil)
+ setmetatableindex(entities,nil)
for name, value in next, characters.entities do
if not entities[name] then
entities[name] = value
end
end
else
- table.setmetatableindex(entities,characters.entities)
+ setmetatableindex(entities,characters.entities)
end
+ loaded = true
end
end