Implement #+LINK

This commit is contained in:
Niklas Fasching 2020-04-17 15:59:03 +02:00
parent 47a3653d61
commit 1e36b3b46b
6 changed files with 19 additions and 0 deletions

View file

@ -338,6 +338,9 @@ func (w *HTMLWriter) WriteRegularLink(l RegularLink) {
if l.Protocol == "file" {
url = url[len("file:"):]
}
if prefix := w.document.Links[l.Protocol]; prefix != "" {
url = html.EscapeString(prefix) + url[len(l.Protocol)+1:]
}
description := url
if l.Description != nil {
description = w.WriteNodesAsString(l.Description...)