From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Bug: HTML Export doesn't handle internal link with spaces [8.0.7 (8.0.7-6-g13cb28-elpa @ /home/jbalint/.emacs.d/elpa/org-20130812/)] Date: Fri, 03 Jan 2014 15:48:57 +0100 Message-ID: <87r48pce92.fsf@bzg.ath.cx> References: <87zjo034l8.wl%jbalint@gmail.com> <87sitnjit3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz63j-00011l-Hh for emacs-orgmode@gnu.org; Fri, 03 Jan 2014 09:49:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vz63b-00017W-59 for emacs-orgmode@gnu.org; Fri, 03 Jan 2014 09:49:11 -0500 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:64179) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vz63a-00017Q-Tr for emacs-orgmode@gnu.org; Fri, 03 Jan 2014 09:49:03 -0500 Received: by mail-wi0-f172.google.com with SMTP id en1so531003wid.11 for ; Fri, 03 Jan 2014 06:49:02 -0800 (PST) In-Reply-To: <87sitnjit3.fsf@gmail.com> (Nicolas Goaziou's message of "Fri, 20 Dec 2013 22:47:52 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org, Jess Balint --=-=-= Content-Type: text/plain Nicolas Goaziou writes: > IMO, `org-insert-link' shouldn't hexify links in all situations (if at > all). Agreed. We can first narrow the set of url-hexified links to those matching `org-link-types-re' (http://, ftp://.) > Anyway, I can't think of any satisfactory solution at the moment. See patch. Of course, there will still be some false positives, because `org-link-types-re' comprises custom link types, but this is a step in the right direction IMO. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=org-don't-url-hexify-all-links.patch diff --git a/lisp/org.el b/lisp/org.el index f7a038e..20e6e33 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9793,11 +9793,10 @@ according to FMT (default from `org-email-link-description-format')." (not (equal link (org-link-escape link)))) (setq description (org-extract-attributes link))) (setq link - (cond ((string-match (org-image-file-name-regexp) link) link) - ((string-match org-link-types-re link) + (cond ((string-match org-link-types-re link) (concat (match-string 1 link) (org-link-escape (substring link (match-end 1))))) - (t (org-link-escape link)))) + (t link))) (concat "[[" link "]" (if description (concat "[" description "]") "") "]")) --=-=-= Content-Type: text/plain -- Bastien --=-=-=--