From 2263b41287ed5dc9c1c4416cc296581f3a466144 Mon Sep 17 00:00:00 2001 From: JP Appel Date: Tue, 5 Aug 2025 13:37:29 -0400 Subject: Change link parsing regex to support trailing slash --- pkg/index/index.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/index/index.go') diff --git a/pkg/index/index.go b/pkg/index/index.go index c69f36d..0c014ee 100644 --- a/pkg/index/index.go +++ b/pkg/index/index.go @@ -501,8 +501,8 @@ func ParseDocs(paths []string, numWorkers uint, opts ParseOpts) (map[string]*Doc func init() { headingPattern := `(?:^|\n)(?#{1,6}.*)` - linkPattern := `\[.*\]\(\s*(?.*)\b\s*\)` - linkHeading := `(?:^|\n)(?#{1,6}\s*\[.*\])\(\s*(?.*)\b\s*\)` + linkPattern := `\[.*\]\(\s*(?.*(?:\b|/))\s*\)` + linkHeading := `(?:^|\n)(?#{1,6}\s*\[.*\])\(\s*(?.*(?:\b|/))\s*\)` DocParseRegex = regexp.MustCompile( linkHeading + "|" + headingPattern + "|" + -- cgit v1.2.3