From 21a479f5ad7fda38584e97c44b5e4ac08293746d Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Mon, 19 Mar 2018 12:20:30 -0400 Subject: [PATCH] Support mailto: in links Fixes https://github.com/kaushalmodi/ox-hugo/issues/149. --- ox-hugo.el | 2 +- test/site/content-org/all-posts.org | 4 ++++ test/site/content/posts/external-links.md | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ox-hugo.el b/ox-hugo.el index 18ba2bb..f6b24d2 100644 --- a/ox-hugo.el +++ b/ox-hugo.el @@ -1822,7 +1822,7 @@ and rewrite link paths to make blogging more seamless." (t (let* ((link-param-str "") (path (cond - ((member type '("http" "https" "ftp")) + ((member type '("http" "https" "ftp" "mailto")) ;; Taken from ox-html.el -- Extract attributes ;; from parent's paragraph. HACK: Only do this ;; for the first link in parent (inner image link diff --git a/test/site/content-org/all-posts.org b/test/site/content-org/all-posts.org index 2a7db3d..ffdfe3d 100644 --- a/test/site/content-org/all-posts.org +++ b/test/site/content-org/all-posts.org @@ -2455,6 +2455,10 @@ Once that is evaluated, links like these will export fine i.e. no #+begin_src org [[gopher://some.gopher.site][Dummy gopher link]] #+end_src +*** Mailto link support +{{{oxhugoissue(149)}}} + +[[mailto:abc@xyz.com][My email]] ** Within the same post (Internal links) :internal_links: *** Link to headings by name :toc:headings:export_option: :PROPERTIES: diff --git a/test/site/content/posts/external-links.md b/test/site/content/posts/external-links.md index 67dff17..6e75371 100644 --- a/test/site/content/posts/external-links.md +++ b/test/site/content/posts/external-links.md @@ -37,3 +37,10 @@ Once that is evaluated, links like these will export fine i.e. no ```org [[gopher://some.gopher.site][Dummy gopher link]] ``` + + +## Mailto link support {#mailto-link-support} + +`ox-hugo` Issue #[149](https://github.com/kaushalmodi/ox-hugo/issues/149) + +[My email](mailto:abc@xyz.com)