fix(publisher): make heading regex linear-time #2

Open
KofTwentyTwo wants to merge 1 commits from feature/security-findings-2026-10 into develop
pull from: feature/security-findings-2026-10
KofTwentyTwo commented 2026-10-16 21:11:34 +00:00 (Migrated from github.com)

Fixes #1

Changes the heading pattern to ^(#{1,6})\s+(\S.*)$ so the separator and the heading text cannot overlap (linear matching). Resolves code-scanning alert #1. A heading line that is only # plus whitespace is no longer treated as a heading with blank text.

Verification: converter compiles (no new tsc errors; the package's existing console lib errors in test-tree.ts are unrelated); a 50,000-space line matches in under 1 ms.

🤖 Generated with Claude Code

Fixes #1 Changes the heading pattern to `^(#{1,6})\s+(\S.*)$` so the separator and the heading text cannot overlap (linear matching). Resolves code-scanning alert #1. A heading line that is only `#` plus whitespace is no longer treated as a heading with blank text. Verification: converter compiles (no new `tsc` errors; the package's existing `console` lib errors in test-tree.ts are unrelated); a 50,000-space line matches in under 1 ms. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Checking for merge conflicts…
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/security-findings-2026-10:feature/security-findings-2026-10
git checkout feature/security-findings-2026-10
Sign in to join this conversation.