ox-html: Properly encode links without a description

* lisp/ox-html.el (org-html-link): Encode URI in default description
  when none is provided.

Reported-by: mail@fritzreichwald.de
<http://permalink.gmane.org/gmane.emacs.orgmode/104645>
This commit is contained in:
Nicolas Goaziou 2016-01-31 23:21:34 +01:00
parent 2f727b0f48
commit 48e046047b
1 changed files with 2 additions and 4 deletions

View File

@ -2963,10 +2963,8 @@ INFO is a plist holding contextual information. See
attributes
desc))
;; External link without a description part.
(path (format "<a href=\"%s\"%s>%s</a>"
(org-html-encode-plain-text path)
attributes
path))
(path (let ((path (org-html-encode-plain-text path)))
(format "<a href=\"%s\"%s>%s</a>" path attributes path)))
;; No path, only description. Try to do something useful.
(t (format "<i>%s</i>" desc)))))