>From 21c3fdc0d7aee2abfe0021248d7565a880a94571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Fabian=20Kr=C3=BCger?= Date: Sun, 27 Nov 2022 04:06:25 +0100 Subject: [PATCH 3/4] Track last node in ligature handling --- source/texk/web2c/luatexdir/font/luafont.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/texk/web2c/luatexdir/font/luafont.c b/source/texk/web2c/luatexdir/font/luafont.c index 2e08facb1..c33037244 100644 --- a/source/texk/web2c/luatexdir/font/luafont.c +++ b/source/texk/web2c/luatexdir/font/luafont.c @@ -2242,6 +2242,7 @@ static halfword handle_lig_nest(halfword root, halfword cur) static halfword handle_lig_word(halfword cur) { halfword right = null; + halfword last = null; if (type(cur) == boundary_node) { halfword prev = alink(cur); halfword fwd = vlink(cur); @@ -2481,9 +2482,10 @@ static halfword handle_lig_word(halfword cur) } else { /*tex We have glyph nor disc. */ - return cur; + return last; } /*tex Goto the next node, where |\par| allows |vlink(cur)| to be NULL. */ + last = cur; cur = vlink(cur); } return cur; -- 2.38.1