|
@@ -8686,16 +8686,19 @@ according to FMT (default from `org-email-link-description-format')."
|
|
|
(setq description (replace-match "{" t t description)))
|
|
|
(while (string-match "\\]" description)
|
|
|
(setq description (replace-match "}" t t description))))
|
|
|
- (when (equal (org-link-escape link) description)
|
|
|
+ (when (equal link description)
|
|
|
;; No description needed, it is identical
|
|
|
(setq description nil))
|
|
|
(when (and (not description)
|
|
|
+ (not (string-match (org-image-file-name-regexp) link))
|
|
|
(not (equal link (org-link-escape link))))
|
|
|
(setq description (org-extract-attributes link)))
|
|
|
- (setq link (if (string-match org-link-types-re link)
|
|
|
- (concat (match-string 1 link)
|
|
|
- (org-link-escape (substring link (match-end 1))))
|
|
|
- (org-link-escape link)))
|
|
|
+ (setq link
|
|
|
+ (cond ((string-match (org-image-file-name-regexp) link) link)
|
|
|
+ ((string-match org-link-types-re link)
|
|
|
+ (concat (match-string 1 link)
|
|
|
+ (org-link-escape (substring link (match-end 1)))))
|
|
|
+ (t (org-link-escape link))))
|
|
|
(concat "[[" link "]"
|
|
|
(if description (concat "[" description "]") "")
|
|
|
"]"))
|