[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: [harf] Handle empty discretionary node as if it belongs to previous run (821c98b)

Marcel Fabian Krüger tex at 2krueger.de
Mon Dec 6 22:41:19 CET 2021


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/821c98b3da0369dea2f2bb2a509f1ec28f49998d

>---------------------------------------------------------------

commit 821c98b3da0369dea2f2bb2a509f1ec28f49998d
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Mon Dec 6 22:40:46 2021 +0100

    [harf] Handle empty discretionary node as if it belongs to previous run


>---------------------------------------------------------------

821c98b3da0369dea2f2bb2a509f1ec28f49998d
 src/luaotfload-harf-plug.lua | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/luaotfload-harf-plug.lua b/src/luaotfload-harf-plug.lua
index 5a22d7f..0f8cce2 100644
--- a/src/luaotfload-harf-plug.lua
+++ b/src/luaotfload-harf-plug.lua
@@ -110,6 +110,11 @@ local endactual_p       = "luaotfload_endactualtext"
 
 local empty_table       = {}
 
+local function is_empty_disc(n)
+  local pre, post, rep = getdisc(n)
+  return not pre and not post and not rep
+end
+
 -- "Copy" properties as done by LuaTeX: Make old properties metatable 
 local function copytable(old)
   local new = {}
@@ -206,7 +211,7 @@ local function itemize(head, fontid, direction)
     elseif id == glue_t and subtype == spaceskip_t then
       code = 0x0020 -- SPACE
     elseif id == disc_t then
-      if uses_font(n, fontid) then
+      if uses_font(n, fontid) or not lastskip and is_empty_disc(n) then
         local _, _, rep, _, _, rep_tail = getdisc(n, true)
         setfield(n, 'replace', nil)
         local prev, next = getboth(n)





More information about the latex3-commits mailing list.