diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2025-07-18 15:25:49 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2025-07-18 15:25:49 -0400 |
| commit | fc2fbe46f25f1f88b5709d191434a96099446277 (patch) | |
| tree | 00478d07ec0ea9026c6ca4ddd3ed25164255691f /pkg | |
| parent | 06b3b478948bfbe1527cf14f912bad6ec5b9dcb7 (diff) | |
Simplify link parsing
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/index/index.go | 4 |
1 files changed, 2 insertions, 2 deletions
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*\)`) } |
