diff options
author | Bastien Guerry <bzg@altern.org> | 2013-01-31 10:44:15 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-01-31 10:44:15 +0100 |
commit | ad45f6cd7f490e86ccc3b34c47da5afcc98c54a7 (patch) | |
tree | 720f669ffca2ecbe39f2207a4263bb94004bb288 | |
parent | b9c506b41e5d989241263b824ce9b8fb5182f1af (diff) | |
download | org-mode-ad45f6cd7f490e86ccc3b34c47da5afcc98c54a7.tar.gz |
org-e-html.el (org-e-html-link): Don't add attributes to the link when they are already part of the link description
* org-e-html.el (org-e-html-link): Don't add attributes to the
link when they are already part of the link description.
-rw-r--r-- | contrib/lisp/org-e-html.el | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/contrib/lisp/org-e-html.el b/contrib/lisp/org-e-html.el index ab46e2a..c08f25b 100644 --- a/contrib/lisp/org-e-html.el +++ b/contrib/lisp/org-e-html.el @@ -2141,15 +2141,17 @@ INFO is a plist holding contextual information. See (if (not (file-name-absolute-p raw-path)) raw-path (concat "file://" (expand-file-name raw-path)))) (t raw-path))) - ;; Extract attributes from parent's paragraph. - (attributes - (let ((attr (mapconcat - 'identity - (org-element-property - :attr_html (org-export-get-parent-element link)) - " "))) - (if attr (concat " " attr) ""))) - protocol) + attributes protocol) + ;; Extract attributes from parent's paragraph. + (and (setq attributes + (mapconcat + 'identity + (let ((att (org-element-property + :attr_html (org-export-get-parent-element link)))) + (unless (and desc (string-match (regexp-quote (car att)) desc)) att)) + " ")) + (setq attributes (concat " " attributes))) + (cond ;; Image file. ((and (or (eq t org-e-html-inline-images) |