fix(publisher): make heading regex linear-time

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
james.maesandClaude Opus 5.5 committed 2026-10-16 16:11:29 -05:00
1 parent 4810c80390
commit 2bc26fbdc5
1 file changed
+2 -1
+2 -1
View File
@@ -49,7 +49,8 @@ export class MarkdownConverter {
const line = lines[i];
// Heading
const headingMatch = line.match(/^(#{1,6})\s+(.+)$/);
// `\s+(\S.*)` keeps the separator and the text disjoint, so matching is linear.
const headingMatch = line.match(/^(#{1,6})\s+(\S.*)$/);
if (headingMatch) {
tokens.push({
type: 'heading',