Closed pgundlach closed 3 years ago
A fix would be something like
diff --git a/src/lua/par.lua b/src/lua/par.lua
index 1cc6cf8a..9f8373df 100644
--- a/src/lua/par.lua
+++ b/src/lua/par.lua
@@ -351,7 +351,7 @@ function Par:mknodelist( options )
if nodelist == nil then
-- the beginning of a new line (perhaps the first new line)
nodelist = thisself
- elseif thisself.id == publisher.vlist_node or publisher.getprop(thisself,"split") then
+ elseif publisher.getprop(thisself,"split") then
-- text right after a newline, so push stuff that we have into the objects list and
-- put what we have into the node list
if nodelist.id == publisher.glue_node and nodelist.prev == nil and nodelist.next == nil then
@@ -360,6 +360,16 @@ function Par:mknodelist( options )
table.insert(objects,nodelist)
end
nodelist = thisself
+ elseif thisself.id == publisher.vlist_node then
+ -- this node is a vlist, so it should appear on a new line
+ if nodelist.id == publisher.glue_node and nodelist.prev == nil and nodelist.next == nil then
+ -- ignore, just glue
+ nodelist = thisself
+ else
+ table.insert(objects,nodelist)
+ table.insert(objects,thisself)
+ nodelist = nil
+ end
else
-- just objects to be appended to the node list
local tail = node.tail(nodelist)
But I am not sure if the current behaviour is better than the last.
Actually, I think it works as intended, so I close this bug.
Commit 980e88785029a99898bfcacde53548942a42611a introduced a bug in newline handling in this case:
This is the result:
This is expected: