mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 05:20:26 +00:00
Fix incorrect display text in links
This commit is contained in:
parent
e8f9bf608f
commit
598a87f878
@ -22,10 +22,12 @@ func LinkParts(addr, display, hyphaName string) (href, text, class, icon string)
|
||||
case strings.ContainsRune(addr, ':'):
|
||||
pos := strings.IndexRune(addr, ':')
|
||||
destination := addr[:pos]
|
||||
if display == "" {
|
||||
text = addr[pos+1:]
|
||||
if strings.HasPrefix(text, "//") && len(text) > 2 {
|
||||
text = text[2:]
|
||||
}
|
||||
}
|
||||
return addr, text, "wikilink_external", fmt.Sprintf(`<img class="wikilink__destination-type" src="/static/icon/%s" width="16" height="16"/>`, destination)
|
||||
case strings.HasPrefix(addr, "/"):
|
||||
return addr, text, class, ""
|
||||
|
Loading…
Reference in New Issue
Block a user