Fixed recognizing Links with spaces
This commit is contained in:
1 parent
523a850ebb
commit
c40a89096f
7 files changed
+44
-30
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user