Org-mode mailing list
 help / color / mirror / Atom feed
From: "turbo.cafe@clovermail.net" <turbo.cafe@clovermail.net>
To: emacs-orgmode@gnu.org
Subject: [PATCH] ox-md.el/markdown-hyperlink
Date: Wed, 04 Nov 2020 08:40:31 +0200
Message-ID: <874km51v6o.fsf@clovermail.net> (raw)

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

exporting to markdown loses radio target hyperlinks.



-------------------------------------------------
This free account was provided by VFEmail.net - report spam to abuse@vfemail.net
 
ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-md.el-markdown-hyperlink.patch --]
[-- Type: text/x-patch, Size: 1073 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/markdown-hyperlink

* ox-md.el (org-md-link): format markdown hyperlink from org radio target


---
 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))))))
 
-- 
2.29.1


                 reply	other threads:[~2020-11-04  6:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://orgmode.org

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

  git send-email \
    --in-reply-to=874km51v6o.fsf@clovermail.net \
    --to=turbo.cafe@clovermail.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git