Fixed recognizing Links with spaces
Node.js build / build (20.x) (push) Has been cancelled
Node.js build / build (22.x) (push) Has been cancelled

This commit is contained in:
Lars committed 2026-02-11 11:56:26 +01:00
1 parent 523a850ebb
commit c40a89096f
7 files changed
+44 -30

No files matched your search

+2 -2
View File
@@ -28,7 +28,7 @@ export function getSectionTypeForHeading(content: string, heading: string): stri
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
if (line === undefined) continue;
const match = line.match(/^(#{1,6})\s+(.+?)(?:\s+\^[\w-]+)?\s*$/);
const match = line.match(/^(#{1,6})\s+(.+?)(?:\s*\^[\w-]+)?\s*$/);
if (match && match[2]) {
const lineHeading = match[2].trim();
if (lineHeading.toLowerCase() === headingNorm) {
@@ -115,7 +115,7 @@ export async function getHeadingsWithSectionTypes(
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
if (line === undefined) continue;
const match = line.match(/^(#{1,6})\s+(.+?)(?:\s+\^[\w-]+)?\s*$/);
const match = line.match(/^(#{1,6})\s+(.+?)(?:\s*\^[\w-]+)?\s*$/);
if (match && match[1] && match[2]) {
const level = match[1].length;
const heading = match[2].trim();