lang/org: add inline base64/http(s) image support
Adds inline image preview support for http/https links, as well as base64 encode image support with the img protocol. e.g. Examples: [[http://domain.com/some/image.png]] [[https://raw.githubusercontent.com/hlissner/doom-emacs/screenshots/company.png]] [[img:iVBORw0KGgoAAAANSUhEUgAAACUAAAAuCAAAAACKMo8cAA...]]
This commit is contained in:
parent
fda4734164
commit
99b7b7f740
3 changed files with 28 additions and 3 deletions
|
@ -119,8 +119,10 @@ If on a:
|
|||
(org-toggle-latex-fragment))
|
||||
|
||||
(`link
|
||||
(let ((path (org-element-property :path (org-element-lineage context '(link) t))))
|
||||
(if (and path (image-type-from-file-name path))
|
||||
(let* ((lineage (org-element-lineage context '(link) t))
|
||||
(path (org-element-property :path lineage)))
|
||||
(if (or (equal (org-element-property :type lineage) "img")
|
||||
(and path (image-type-from-file-name path)))
|
||||
(+org/refresh-inline-images)
|
||||
(org-open-at-point))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue