Export attributes specified with :attr_rst for links (3b5e2665)
This commit is contained in:
22
ox-rst.el
22
ox-rst.el
@@ -964,19 +964,25 @@ INFO is a plist holding contextual information."
|
|||||||
(concat (file-name-as-directory home) raw-path)))
|
(concat (file-name-as-directory home) raw-path)))
|
||||||
(t raw-path)))
|
(t raw-path)))
|
||||||
(t raw-path)))
|
(t raw-path)))
|
||||||
;; Extract attributes from parent's paragraph. HACK: Only do
|
|
||||||
;; this for the first link in parent (inner image link for
|
|
||||||
;; inline images). This is needed as long as attributes
|
|
||||||
;; cannot be set on a per link basis.
|
|
||||||
(attributes-plist
|
(attributes-plist
|
||||||
|
(org-combine-plists
|
||||||
|
;; Extract attributes from parent's paragraph. HACK: Only
|
||||||
|
;; do this for the first link in parent (inner image link
|
||||||
|
;; for inline images). This is needed as long as
|
||||||
|
;; attributes cannot be set on a per link basis.
|
||||||
(let* ((parent (org-export-get-parent-element link))
|
(let* ((parent (org-export-get-parent-element link))
|
||||||
(link (let ((container (org-export-get-parent link)))
|
(link (let ((container (org-export-get-parent link)))
|
||||||
(if (and (eq (org-element-type container) 'link)
|
(if (and (eq 'link (org-element-type container))
|
||||||
(org-rst-inline-image-p link info))
|
(org-html-inline-image-p link info))
|
||||||
container
|
container
|
||||||
link))))
|
link))))
|
||||||
(and (eq (org-element-map parent 'link 'identity info t) link)
|
(and (eq link (org-element-map parent 'link #'identity info t))
|
||||||
(org-export-read-attribute :attr_rst parent))))
|
(org-export-read-attribute :attr_ parent)))
|
||||||
|
;; Also add attributes from link itself. Currently, those
|
||||||
|
;; need to be added programmatically before `org-html-link'
|
||||||
|
;; is invoked, for example, by backends building upon HTML
|
||||||
|
;; export.
|
||||||
|
(org-export-read-attribute :attr_rst link)))
|
||||||
(attributes
|
(attributes
|
||||||
(let ((attr (org-rst--make-attribute-string attributes-plist)))
|
(let ((attr (org-rst--make-attribute-string attributes-plist)))
|
||||||
(if (org-string-nw-p attr) (concat "\n" attr "\n") ""))))
|
(if (org-string-nw-p attr) (concat "\n" attr "\n") ""))))
|
||||||
|
|||||||
Reference in New Issue
Block a user