Support image link. fixed #2

This commit is contained in:
IGARASHI Masanao
2014-11-21 13:00:26 +09:00
parent 355c30c2a3
commit 18b4c4d74f

View File

@@ -967,6 +967,19 @@ if its description is a single link targeting an image file."
info t))))) info t)))))
(defun my-org-export-inline-image-p (link &optional rules)
(let ((case-fold-search t)
(rules (or rules org-export-default-inline-image-rule)))
(catch 'exit
(mapc
(lambda (rule)
(if (string-match (cdr rule) link)
(throw 'exit t)))
rules)
;; Return nil if no rule matched.
nil)))
(defun org-rst-link (link desc info) (defun org-rst-link (link desc info)
"Transcode a LINK object from Org to reStructuredText. "Transcode a LINK object from Org to reStructuredText.
@@ -1033,6 +1046,11 @@ INFO is a plist holding contextual information."
(if caption (format ".. figure:: %s%s\n %s\n" ipath attributes (if caption (format ".. figure:: %s%s\n %s\n" ipath attributes
(org-export-data caption info)) (org-export-data caption info))
(format ".. image:: %s%s\n" ipath attributes)))) (format ".. image:: %s%s\n" ipath attributes))))
((and (plist-get info :rst-inline-images)
desc
(my-org-export-inline-image-p
desc (plist-get info :rst-inline-image-rules)))
(format ".. image:: %s\n :target: %s%s" desc path attributes))
;; Radio link: Transcode target's contents and use them as link's ;; Radio link: Transcode target's contents and use them as link's
;; description. ;; description.
((string= type "radio") ((string= type "radio")