From fc2fbe46f25f1f88b5709d191434a96099446277 Mon Sep 17 00:00:00 2001 From: JP Appel Date: Fri, 18 Jul 2025 15:25:49 -0400 Subject: Simplify link parsing --- pkg/index/index.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/index') diff --git a/pkg/index/index.go b/pkg/index/index.go index 13c4f45..4db1eb4 100644 --- a/pkg/index/index.go +++ b/pkg/index/index.go @@ -368,7 +368,7 @@ func ParseDoc(path string, opts ParseOpts) (*Document, error) { panic("Link parsing regex returned unexpected number of matches") } link := string(match[1]) - if len(link) > 0 && len(strings.TrimSpace(link)) > 0 { + if len(link) > 0 { doc.Links = append(doc.Links, link) } } @@ -421,5 +421,5 @@ func ParseDocs(paths []string, numWorkers uint, opts ParseOpts) map[string]*Docu } func init() { - linkRegex = regexp.MustCompile(`\[.*\]\((.*)\)`) + linkRegex = regexp.MustCompile(`\[.*\]\(\s*(\S+)\s*\)`) } -- cgit v1.2.3