From 1f105eff3907b4b5b1ad26a7386e4910d34e0123 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sun, 19 Jul 2020 17:21:13 +0200 Subject: [PATCH] Don't add keywords to the backrefs --- util.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/util.go b/util.go index 702ab4f..eb90c1c 100644 --- a/util.go +++ b/util.go @@ -40,7 +40,7 @@ func RandStringBytes(n int) string { func ParseLinks(blockId string, content string) ([]ParsedLink, error) { hrefRE := regexp.MustCompile(`(#?\[\[\s*([^\]]+)\s*\]\])`) - keywordsRE := regexp.MustCompile(`(\w+)::`) + // keywordsRE := regexp.MustCompile(`(\w+)::`) scanner := bufio.NewScanner(strings.NewReader(content)) scanner.Split(bufio.ScanLines) @@ -67,12 +67,12 @@ func ParseLinks(blockId string, content string) ([]ParsedLink, error) { 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}) - } + // 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