Show keyword before value in links
This commit is contained in:
parent
d50857c528
commit
86ea8ceaf9
14
util.go
14
util.go
|
@ -82,6 +82,13 @@ func ParseLinks(blockId string, content string) ([]ParsedLink, error) {
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := scanner.Text()
|
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)
|
links := hrefRE.FindAllStringSubmatch(line, -1)
|
||||||
|
|
||||||
for _, matches := range links {
|
for _, matches := range links {
|
||||||
|
@ -98,13 +105,6 @@ func ParseLinks(blockId string, content string) ([]ParsedLink, error) {
|
||||||
l := cleanNameURL(link)
|
l := cleanNameURL(link)
|
||||||
result = append(result, ParsedLink{blockId, link, l, line, ""})
|
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
|
return result, nil
|
||||||
|
|
Loading…
Reference in New Issue
Block a user