From 7b271baae19db1528fbe6621bdf50af89a5a336b Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Fri, 22 Feb 2019 20:29:46 +0100 Subject: 2019-02-22 19:43:00 --- tex/context/base/mkiv/symb-emj.lua | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'tex/context/base/mkiv/symb-emj.lua') 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) -- cgit v1.2.3