mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-13 19:15:40 +00:00
The parser for \iftrue, \iffalse, and \ifmmode stopped at the first \else or \fi it saw, so a nested conditional inside a skipped branch (e.g. an unsupported primitive like \ifdim) made the outer conditional end early and leaked tokens from the skipped branch. Replace the sub-parse with a pure token scan that tracks nesting depth, recognizing TeX's primitive conditionals as well as \newif-defined ones, and (like TeX) does not expand tokens while skipping a branch. Co-Authored-By: Claude <noreply@anthropic.com>