forked from mirrors/org-mode
org-link-make-string: Throw error when both LINK and DESCRIPTION are empty
This behaviour is expected according to `test-ol/make-string'.
This commit is contained in:
parent
87babca898
commit
f28f02bde9
|
@ -999,7 +999,9 @@ LINK is escaped with backslashes for inclusion in buffer."
|
||||||
(replace-regexp-in-string "]\\'"
|
(replace-regexp-in-string "]\\'"
|
||||||
(concat "\\&" zero-width-space)
|
(concat "\\&" zero-width-space)
|
||||||
(org-trim description))))))
|
(org-trim description))))))
|
||||||
(if (not (org-string-nw-p link)) description
|
(if (not (org-string-nw-p link))
|
||||||
|
(or description
|
||||||
|
(error "Empty link"))
|
||||||
(format "[[%s]%s]"
|
(format "[[%s]%s]"
|
||||||
(org-link-escape link)
|
(org-link-escape link)
|
||||||
(if description (format "[%s]" description) "")))))
|
(if description (format "[%s]" description) "")))))
|
||||||
|
|
Loading…
Reference in New Issue