emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: emacs-orgmode@gnu.org, Jess Balint <jbalint@gmail.com>
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	[thread overview]
Message-ID: <87r48pce92.fsf@bzg.ath.cx> (raw)
In-Reply-To: <87sitnjit3.fsf@gmail.com> (Nicolas Goaziou's message of "Fri, 20 Dec 2013 22:47:52 +0100")

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

Nicolas Goaziou <n.goaziou@gmail.com> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-don't-url-hexify-all-links.patch --]
[-- Type: text/x-diff, Size: 720 bytes --]

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 "]") "")
 	  "]"))

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

  reply	other threads:[~2014-01-03 14:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 20:48 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/)] Jess Balint
2013-12-20 21:47 ` Nicolas Goaziou
2014-01-03 14:48   ` Bastien [this message]
2014-01-03 15:05     ` Nicolas Goaziou
2014-01-04 14:35       ` Bastien
2014-01-05  0:03         ` Nicolas Goaziou
2014-01-05  6:45           ` Bastien
2014-01-06 11:32             ` Nicolas Goaziou
2014-01-06 16:36               ` Bastien

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://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87r48pce92.fsf@bzg.ath.cx \
    --to=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=jbalint@gmail.com \
    --cc=n.goaziou@gmail.com \
    /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
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

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