Skip to content

remove assertion of direction matching between begin/end dir nodes#325

Open
Udi-Fogiel wants to merge 1 commit intolatex3:devfrom
Udi-Fogiel:dev
Open

remove assertion of direction matching between begin/end dir nodes#325
Udi-Fogiel wants to merge 1 commit intolatex3:devfrom
Udi-Fogiel:dev

Conversation

@Udi-Fogiel
Copy link
Copy Markdown

LuaTeX does not really care about the direction of an enddir node, it only consider it as a flag to pop the current dir, and restore the old one (see pdflistout.c).

I don't think luaotfload should be more restrictive then the engine.

LuaTeX does not really care about the direction of an
enddir node, it only consider it as a flag to pop the current dir,
and restore the old one (see pdflistout.c).
@zauguin
Copy link
Copy Markdown
Member

zauguin commented Apr 22, 2026

I somewhat disagree. If the direction here does not match the nodes are in an unexpected state and we might not recover correctly. Any case where this occurs at the very least would have to be separately checked.

What is the motivation for this change?

@Udi-Fogiel
Copy link
Copy Markdown
Author

Udi-Fogiel commented Apr 22, 2026

If the direction here does not match the nodes are in an unexpected state and we might not recover correctly.

Hmmm can you elaborate? As far as I can tell LuaTeX is a bit more permissive about dir nodes structure, so what is an expected state?

What is the motivation for this change?

Not a real motivation, just noticed it when playing with things and thought that this check is a bit too harsh.

But thinking about it more, it is unclear from LuaTeX's source what should happen. The output to pdf code does not check the direction of enddir nodes, but the line breaker somewhat cares about them... so there seems to be some inconsistency about it even in the source code.

It is somewhat puzzling why enddir nodes have direction in the first place, if it does not affect anything.

Any case where this occurs at the very least would have to be separately checked.

There are cases, even without lua, where there are unbalanced dir nodes, though maybe they should be considered a bug. For example the undocumented \fixupboxesmode fix one of these cases, see https://mailman.ntg.nl/archives/list/dev-luatex@ntg.nl/thread/2PZX3W7322ZZZM4YB3WZVTO5EF4YKXHY/ for another.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants