Fix #+LINK: file xyz edge case
if we define a custom LINK for file we run into index problems bc it's trimmed before already - this fixes that. Shouldn't ever happen but whatever, fuzzing found it.
This commit is contained in:
parent
1e36b3b46b
commit
2ab65d300a
1 changed files with 1 additions and 1 deletions
|
@ -339,7 +339,7 @@ func (w *HTMLWriter) WriteRegularLink(l RegularLink) {
|
||||||
url = url[len("file:"):]
|
url = url[len("file:"):]
|
||||||
}
|
}
|
||||||
if prefix := w.document.Links[l.Protocol]; prefix != "" {
|
if prefix := w.document.Links[l.Protocol]; prefix != "" {
|
||||||
url = html.EscapeString(prefix) + url[len(l.Protocol)+1:]
|
url = html.EscapeString(prefix) + strings.TrimPrefix(url, l.Protocol+":")
|
||||||
}
|
}
|
||||||
description := url
|
description := url
|
||||||
if l.Description != nil {
|
if l.Description != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue