ox-ascii.el: Consistently add brackets around links
* lisp/ox-ascii.el (org-ascii-link): Add square brackets around description of fuzzy links when they are exported inline. * lisp/ol-docview.el (org-docview-export): * lisp/ox-ascii.el (org-ascii-link): Export links with square brackets around description and angle brackets around path. This make export of links inline (when `org-ascii-links-to-notes' is nil) consistent with "http:" links: "[DESC] (<URI>)". I would drop brackets for "http:" and similar links instead ("DESC (<URI>)" or even "DESC <URI>"), but any case I prefer consistency. Ihor Radchenko to emacs-orgmode. Re: [RFC][PATCH] Allow to export to ascii custom link types as notes. Tue, 24 Oct 2023 10:40:41 +0000. <https://list.orgmode.org/87edhk717a.fsf@localhost>
This commit is contained in:
parent
f632def07c
commit
9cbaf8e49c
|
@ -67,7 +67,7 @@
|
||||||
(cond
|
(cond
|
||||||
((eq backend 'html) (format "<a href=\"%s\">%s</a>" path desc))
|
((eq backend 'html) (format "<a href=\"%s\">%s</a>" path desc))
|
||||||
((eq backend 'latex) (format "\\href{%s}{%s}" path desc))
|
((eq backend 'latex) (format "\\href{%s}{%s}" path desc))
|
||||||
((eq backend 'ascii) (format "%s (%s)" desc path))
|
((eq backend 'ascii) (format "[%s] (<%s>)" desc path))
|
||||||
(t path)))))
|
(t path)))))
|
||||||
|
|
||||||
(defun org-docview-open (link _)
|
(defun org-docview-open (link _)
|
||||||
|
|
|
@ -91,7 +91,7 @@ BACKEND is the current export backend."
|
||||||
((eq backend 'html) (format "<a target=\"_blank\" href=\"%s\">%s</a>" path desc))
|
((eq backend 'html) (format "<a target=\"_blank\" href=\"%s\">%s</a>" path desc))
|
||||||
((eq backend 'latex) (format "\\href{%s}{%s}" path desc))
|
((eq backend 'latex) (format "\\href{%s}{%s}" path desc))
|
||||||
((eq backend 'texinfo) (format "@uref{%s,%s}" path desc))
|
((eq backend 'texinfo) (format "@uref{%s,%s}" path desc))
|
||||||
((eq backend 'ascii) (format "%s (%s)" desc path))
|
((eq backend 'ascii) (format "[%s] (<%s>)" desc path))
|
||||||
((eq backend 'md) (format "[%s](%s)" desc path))
|
((eq backend 'md) (format "[%s](%s)" desc path))
|
||||||
(t path))))
|
(t path))))
|
||||||
|
|
||||||
|
|
|
@ -1607,9 +1607,9 @@ INFO is a plist holding contextual information."
|
||||||
((guard desc)
|
((guard desc)
|
||||||
(if (plist-get info :ascii-links-to-notes)
|
(if (plist-get info :ascii-links-to-notes)
|
||||||
(format "[%s]" desc)
|
(format "[%s]" desc)
|
||||||
(concat desc
|
(format "[%s] (%s)"
|
||||||
(format " (%s)"
|
desc
|
||||||
(org-ascii--describe-datum destination info)))))
|
(org-ascii--describe-datum destination info))))
|
||||||
;; External file.
|
;; External file.
|
||||||
(`plain-text destination)
|
(`plain-text destination)
|
||||||
(`headline
|
(`headline
|
||||||
|
|
Loading…
Reference in New Issue