From 86ea8ceaf9f3a3d157bf014b0fce0ff7402a2782 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sun, 8 Aug 2021 23:44:02 +0200 Subject: [PATCH] Show keyword before value in links --- util.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/util.go b/util.go index 015972c..72a29f3 100644 --- a/util.go +++ b/util.go @@ -82,6 +82,13 @@ func ParseLinks(blockId string, content string) ([]ParsedLink, error) { for scanner.Scan() { line := scanner.Text() + keywords := keywordsRE.FindAllStringSubmatch(line, -1) + for _, matches := range keywords { + link := matches[1] + l := cleanNameURL(link) + result = append(result, ParsedLink{blockId, link, l, line, ""}) + } + links := hrefRE.FindAllStringSubmatch(line, -1) for _, matches := range links { @@ -98,13 +105,6 @@ func ParseLinks(blockId string, content string) ([]ParsedLink, error) { l := cleanNameURL(link) result = append(result, ParsedLink{blockId, link, l, line, ""}) } - - keywords := keywordsRE.FindAllStringSubmatch(line, -1) - for _, matches := range keywords { - link := matches[1] - l := cleanNameURL(link) - result = append(result, ParsedLink{blockId, link, l, line, ""}) - } } return result, nil