mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-27 05:32:52 +00:00
Process link descriptions in HTML export like any content.
Link descriptions where so far exported literally. However, really they need to escape special characters and have TeX-like macros interpreted and emphasis enabled just like any other text. This patch makes sure link descriptions are passed through a new filter, `org-export-html-format-desc' which does just that. This fix is a follow-up to a report by Sebastian Rose.
This commit is contained in:
parent
cceb998feb
commit
15b4ae9038
|
@ -1,5 +1,8 @@
|
|||
2008-11-03 Carsten Dominik <dominik@science.uva.nl>
|
||||
|
||||
* org-exp.el (org-export-as-html): Fully process link descriptions.
|
||||
(org-export-html-format-desc): New function.
|
||||
|
||||
* org-agenda.el (org-agenda-remove-marked-text): Bind variable
|
||||
BEG.
|
||||
|
||||
|
|
|
@ -3218,7 +3218,9 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
"<a href=\"#"
|
||||
(org-solidify-link-text
|
||||
(save-match-data (org-link-unescape path)) nil)
|
||||
"\"" attr ">" desc "</a>")))
|
||||
"\"" attr ">"
|
||||
(org-export-html-format-desc desc)
|
||||
"</a>")))
|
||||
((member type '("http" "https"))
|
||||
;; standard URL, just check if we need to inline an image
|
||||
(if (and (or (eq t org-export-html-inline-images)
|
||||
|
@ -3229,13 +3231,16 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(setq rpl (concat "<a href=\""
|
||||
(org-export-html-format-href link)
|
||||
"\"" attr ">"
|
||||
desc "</a>"))))
|
||||
(org-export-html-format-desc desc)
|
||||
"</a>"))))
|
||||
((member type '("ftp" "mailto" "news"))
|
||||
;; standard URL
|
||||
(setq link (concat type ":" path))
|
||||
(setq rpl (concat "<a href=\""
|
||||
(org-export-html-format-href link)
|
||||
"\"" attr ">" desc "</a>")))
|
||||
"\"" attr ">"
|
||||
(org-export-html-format-desc desc)
|
||||
"</a>")))
|
||||
|
||||
((functionp (setq fnc (nth 2 (assoc type org-link-protocols))))
|
||||
;; The link protocol has a function for format the link
|
||||
|
@ -3281,7 +3286,8 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(not descp))))
|
||||
(concat "<img src=\"" thefile "\"" attr "/>")
|
||||
(concat "<a href=\"" thefile "\"" attr ">"
|
||||
desc "</a>")))
|
||||
(org-export-html-format-desc desc)
|
||||
"</a>")))
|
||||
(if (not valid) (setq rpl desc))))
|
||||
|
||||
(t
|
||||
|
@ -3557,6 +3563,13 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
s (replace-match "&" t t s)))))
|
||||
s)
|
||||
|
||||
(defun org-export-html-format-desc (s)
|
||||
"Make sure the S is valid as a description in a link."
|
||||
(if s
|
||||
(save-match-data
|
||||
(org-html-do-expand s))
|
||||
s))
|
||||
|
||||
(defvar org-table-colgroup-info nil)
|
||||
(defun org-format-table-ascii (lines)
|
||||
"Format a table for ascii export."
|
||||
|
@ -3913,7 +3926,9 @@ that uses these same face definitions."
|
|||
(while (string-match "<" s)
|
||||
(setq s (replace-match "<" t t s)))
|
||||
(while (string-match ">" s)
|
||||
(setq s (replace-match ">" t t s))))
|
||||
(setq s (replace-match ">" t t s)))
|
||||
(while (string-match "\"" s)
|
||||
(setq s (replace-match """ t t s))))
|
||||
s)
|
||||
|
||||
(defun org-export-cleanup-toc-line (s)
|
||||
|
|
Loading…
Reference in a new issue