Port Bun’s BracketMatches single-pass map into Home. Link/image lookahead currently rescans the remaining paragraph for every opener, making unclosed and deeply balanced bracket floods quadratic. Build and recycle one map per top-level inline slice, share it with recursive label sub-slices by pointer offset, preserve code-span/HTML/autolink/escape precedence, and retain a semantic fallback only for tokenization divergence. Parent tracker: #66. Follow-up iterative label frames will remove native-stack recursion separately.
perf(markdown): precompute bracket matches for each inline block
#744Implemented and pushed in 49dc258. Home now builds one Bun-style bracket map per top-level inline slice, threads the unmatched-opener stack through recycled pair storage, preserves escape/code-span/HTML/autolink precedence, shares absolute offsets with recursive label sub-slices, and falls back only when a caller's tokenization is genuinely absent from the map. Zig AST, formatter, and whitespace checks pass. Guarded native corpus acceptance remains pending behind the machine-wide heavy-run lock.
Sign in to comment on this issue.