emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Export of irc links in ox-html
@ 2017-09-24  5:18 Jay Kamat
  2017-09-24  7:20 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Jay Kamat @ 2017-09-24  5:18 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi!

IRC links in ox-html are currently broken. There exists a special 'irc'
content handler on the web, telling browsers to open an irc link in an
external irc client. The format for such links seems identical to org
(irc:irc.freenode.net/user).

Previously links such as:

[[irc:irc.freenode.net/test][Irc link]]

Would export to 

<a href="irc.freenode.net/test">Irc link</a>

in ox-html.

After this tiny patch, it exports to:

<a href="irc:irc.freenode.net/test">Irc link</a>

which tells browsers such as firefox to open links in irc clients.

Let me know if you find any issues!

-Jay


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-html.el-Fix-irc-links-exporting-to-link-to-local-.patch --]
[-- Type: text/x-diff, Size: 1023 bytes --]

From fa1a5ad3bf63158775ffa8ab3de37fb056103ab4 Mon Sep 17 00:00:00 2001
From: Jay Kamat <jaygkamat@gmail.com>
Date: Sun, 24 Sep 2017 01:11:42 -0400
Subject: [PATCH] ox-html.el: Fix irc links exporting to link to local files

* lisp/ox-html.el: Add "irc" to special link types which are exported
  as their link type and path separated by ':', so that browser irc
  content handlers work properly.
---
 lisp/ox-html.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index d91ca73622..8756cda7e5 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2973,7 +2973,7 @@ INFO is a plist holding contextual information.  See
 	 (desc (org-string-nw-p desc))
 	 (path
 	  (cond
-	   ((member type '("http" "https" "ftp" "mailto" "news"))
+	   ((member type '("http" "https" "ftp" "mailto" "news" "irc"))
 	    (url-encode-url (org-link-unescape (concat type ":" raw-path))))
 	   ((string= type "file")
 	    ;; Treat links to ".org" files as ".html", if needed.
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-09-25 13:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-24  5:18 [PATCH] Export of irc links in ox-html Jay Kamat
2017-09-24  7:20 ` Nicolas Goaziou
2017-09-24 16:28   ` Jay Kamat
2017-09-24 16:35     ` Nicolas Goaziou
2017-09-25  1:34       ` Jay Kamat
2017-09-25 13:52         ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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