Files
pandoc/src/Text
John MacFarlaneandClaude ef442564af Text.Pandoc.Readers.Muse: check raw line before parsing table rows.
Table row parsers are speculatively tried at every paragraph line
boundary via the terminator continuation.  Each of the three row
variants would fully inline-parse the line before failing for lack of
a cell separator, so every paragraph line was inline-parsed several
times.

Since cell separators (whitespace followed by pipes) cannot span
lines, scanning the raw line for one lets us reject non-table lines
without any inline parsing.  The check is conservative and never
rejects a line a row parser could accept.

Together with the previous commit, this makes the reader 4.3x faster
on a 1.6 MB test document and reduces heap allocation by 87%.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-09-09 23:30:32 -07:00
..
…