Strip list item from backref lines

This commit is contained in:
Peter Stuifzand 2020-06-28 22:04:14 +02:00
parent 3d555226cf
commit 3f41a219f7

View File

@ -88,7 +88,11 @@ func loadBackrefs(fp *FilePages, p string) (map[string][]Backref, error) {
result[ref.Name] = nil result[ref.Name] = nil
} }
links := renderLinks(strings.TrimLeft(ref.Link.Line, " *")) line := strings.TrimLeft(ref.Link.Line, " ")
if line[0] == '*' && line[1] == ' ' {
line = line[2:]
}
links := renderLinks(line)
pageText := renderMarkdown2(links) pageText := renderMarkdown2(links)
removeBrackets := func(r rune) rune { removeBrackets := func(r rune) rune {
@ -102,7 +106,7 @@ func loadBackrefs(fp *FilePages, p string) (map[string][]Backref, error) {
Name: ref.Name, Name: ref.Name,
Title: title, Title: title,
LineHTML: template.HTML(pageText), LineHTML: template.HTML(pageText),
Line: strings.Map(removeBrackets, ref.Link.Line), Line: strings.Map(removeBrackets, ref.Link.Line),
}) })
} }