mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
de9bd94279
fix(plugin-sdk): stop the README heading match backtracking `missingSections()` matched headings with `(.+?)\s*(?:<!--.*)?$`, where the lazy body and the trailing `\s*` compete over the same run of spaces. That backtracks quadratically: a heading line padded with 80k spaces takes about 12 seconds, 200k about 75. The gate runs over READMEs anyone can submit to the registry, so the padding is not the author own input. The trailing anchor comment is now cut with indexOf, and the body is matched with its edges pinned to non-space, so nothing competes with the trailing `\s*`. Same shape the wiki sidebar parser was rewritten to for the same reason. Behaviour is unchanged on every heading that is not the attack: trailing comment, unterminated comment, tab separator, padded title. scripts/check-readme.mjs in the TREK-Plugins registry carries the same regex and needs the same change. @