html: Rewrite local links to .org files to .html
emacs rewrites links to `.org` files to corresponding links with `.html` extension in the html export.
This commit is contained in:
parent
1b68e209ac
commit
84d56e9562
4 changed files with 20 additions and 12 deletions
|
@ -342,6 +342,9 @@ func (w *HTMLWriter) WriteRegularLink(l RegularLink) {
|
|||
if l.Protocol == "file" {
|
||||
url = url[len("file:"):]
|
||||
}
|
||||
if (l.Protocol == "file" || l.Protocol == "") && strings.HasSuffix(url, ".org") {
|
||||
url = strings.TrimSuffix(url, ".org") + ".html"
|
||||
}
|
||||
if prefix := w.document.Links[l.Protocol]; prefix != "" {
|
||||
url = html.EscapeString(prefix) + strings.TrimPrefix(url, l.Protocol+":")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue