emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "nazar.stasiv@atk.sk" <nazar.stasiv@atk.sk>
To: emacs-orgmode@gnu.org
Subject: [PATCH] ox-md.el/preserve radio target hyperlink
Date: Tue, 03 Nov 2020 22:40:38 +0200	[thread overview]
Message-ID: <87wnz2fa2h.fsf@atk.sk> (raw)

[-- Attachment #1: Type: text/plain, Size: 55 bytes --]

exporting to markdown looses radio target hyperlinks.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-md.el-preserve-radio-target-hyperlink.patch --]
[-- Type: text/x-patch, Size: 1084 bytes --]

From bbe8ef631467f9f5f097412a946a82d38e96235c Mon Sep 17 00:00:00 2001
From: "turbo.cafe@clovermail.net" <turbo.cafe@clovermail.net>
Date: Tue, 3 Nov 2020 22:24:03 +0200
Subject: [PATCH] ox-md.el/preserve radio target hyperlink

* ox-md.el (org-md-link): format markdown hyperlink from org radio
 lisp/ox-md.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-md.el b/lisp/ox-md.el
index 1d20c04f4..a63815e43 100644
--- a/lisp/ox-md.el
+++ b/lisp/ox-md.el
@@ -543,7 +543,13 @@ INFO is a plist holding contextual information.  See
      ((string= type "coderef")
       (format (org-export-get-coderef-format path desc)
 	      (org-export-resolve-coderef path info)))
-     ((equal type "radio") desc)
+     ((string= type "radio")
+      (let ((destination (org-export-resolve-radio-link link info)))
+	(if (not destination) desc
+	  (format "<a href=\"#%s\"%s>%s</a>"
+		  (org-export-get-reference destination info)
+		  ""
+		  desc))))
      (t (if (not desc) (format "<%s>" path)
 	  (format "[%s](%s)" desc path))))))

             reply	other threads:[~2020-11-05 20:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03 20:40 nazar.stasiv [this message]
2021-01-03 10:11 ` [PATCH] ox-md.el/preserve radio target hyperlink TEC

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnz2fa2h.fsf@atk.sk \
    --to=nazar.stasiv@atk.sk \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).