diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/symb-emj.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/symb-emj.lua | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/symb-emj.lua b/Master/texmf-dist/tex/context/base/mkiv/symb-emj.lua index d6e2aebea6f..3075e09854f 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/symb-emj.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/symb-emj.lua @@ -19,27 +19,32 @@ local protectglyphs = nodes.handlers.protectglyphs local tonodes = nodes.tonodes local currentfont = font.current -local nuts = nodes.nuts -local tonode = nuts.tonode -local tonut = nuts.tonut -local remove_node = nuts.remove -local isglyph = nuts.isglyph +-- 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 function removemodifiers(head) - local head = tonut(head) local current = head while current do - local char, id = isglyph(current) - if char and char == 0x200D or (char >= 0x1F3FB and char <= 0x1F3FF) then - head, current = remove_node(head,current,true) + 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 else current = getnext(current) end end - return tonode(head) + return head end --- fast enough, no need to memoize, maybe use attributes +-- attributes local function checkedemoji(name,id) local str = resolvedemoji(name) |