The original PR (#1337) used \Z in a JavaScript regex, which is a Perl/Python/Ruby anchor — JavaScript interprets it as a literal match for the character 'Z', silently truncating expected text containing that letter. Replace with a two-pass approach: try next-key lookahead first, fall back to greedy match to end-of-string. Also remove the redundant `to=all:` pattern in sanitizeForDisplay() since it is a subset of the existing `to=[^:\s]+:` pattern. Add regression tests proving the Z-truncation bug and verifying expected blocks at end-of-section parse correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 KiB
13 KiB