summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/symb-emj.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-02-22 20:29:46 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-02-22 20:29:46 +0100
commit7b271baae19db1528fbe6621bdf50af89a5a336b (patch)
tree4fc24a8f2be20aa90e90f6e1bcb62d69f4946235 /tex/context/base/mkiv/symb-emj.lua
parent67b9965fe473d18f13ed4c40f1e4e008eb870322 (diff)
downloadcontext-7b271baae19db1528fbe6621bdf50af89a5a336b.tar.gz
2019-02-22 19:43:00
Diffstat (limited to 'tex/context/base/mkiv/symb-emj.lua')
-rw-r--r--tex/context/base/mkiv/symb-emj.lua27
1 files changed, 11 insertions, 16 deletions
diff --git a/tex/context/base/mkiv/symb-emj.lua b/tex/context/base/mkiv/symb-emj.lua
index 3075e0985..d6e2aebea 100644
--- a/tex/context/base/mkiv/symb-emj.lua
+++ b/tex/context/base/mkiv/symb-emj.lua
@@ -19,32 +19,27 @@ local protectglyphs = nodes.handlers.protectglyphs
local tonodes = nodes.tonodes
local currentfont = font.current
--- fast enough, no need to memoize
-
-local glyph_code = nodes.nodecodes.glyph
-local remove_node = nodes.remove
-local getid = nodes.getid
-local getnext = nodes.getnext
-local getchar = nodes.getchar
+local nuts = nodes.nuts
+local tonode = nuts.tonode
+local tonut = nuts.tonut
+local remove_node = nuts.remove
+local isglyph = nuts.isglyph
local function removemodifiers(head)
+ local head = tonut(head)
local current = head
while current do
- if getid(current) == glyph_code then
- local char = getchar(current) -- using categories is too much
- if char == 0x200D or (char >= 0x1F3FB and char <= 0x1F3FF) then
- head, current = remove_node(head,current,true)
- else
- current = getnext(current)
- end
+ local char, id = isglyph(current)
+ if char and char == 0x200D or (char >= 0x1F3FB and char <= 0x1F3FF) then
+ head, current = remove_node(head,current,true)
else
current = getnext(current)
end
end
- return head
+ return tonode(head)
end
--- attributes
+-- fast enough, no need to memoize, maybe use attributes
local function checkedemoji(name,id)
local str = resolvedemoji(name)