remove assertion of direction matching between begin/end dir nodes#325
remove assertion of direction matching between begin/end dir nodes#325Udi-Fogiel wants to merge 1 commit intolatex3:devfrom
Conversation
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 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? |
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?
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.
There are cases, even without lua, where there are unbalanced dir nodes, though maybe they should be considered a bug. For example the undocumented |
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.