diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-01-25 20:34:48 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-01-25 20:34:48 +0100 |
commit | 55575b7cad42dac55b4a5f699c33363489cb502d (patch) | |
tree | 90b2fd06d12f00dab66e28824744c345a7f6703a /tex/context/base/mkiv/symb-emj.lua | |
parent | 3861c9ef2ffeffe824f05a255534d61800e27e7a (diff) | |
download | context-55575b7cad42dac55b4a5f699c33363489cb502d.tar.gz |
2019-01-25 20:15:00
Diffstat (limited to 'tex/context/base/mkiv/symb-emj.lua')
-rw-r--r-- | tex/context/base/mkiv/symb-emj.lua | 27 |
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) |