From 61bef3b78584d0d64c40c4430529742cf77e64d1 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Tue, 17 Aug 2021 21:35:39 +0200 Subject: [PATCH] Disable keyword links in backrefs --- util.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/util.go b/util.go index de00a44..403d0d6 100644 --- a/util.go +++ b/util.go @@ -72,7 +72,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) @@ -82,12 +82,12 @@ 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, ""}) - } + // 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)