emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: HTTP links that contain %20 get malformed to %2520 - affects ODT export [9.2.1 (9.2.1-dist @ /home/ehere/emacs-scripts/org-9.2.1/lisp/)]
@ 2019-02-22  4:33 Edmund Christian Herenz
  2019-03-01 17:06 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Edmund Christian Herenz @ 2019-02-22  4:33 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Consider the following HTTP link:
http://skyserver.sdss.org/dr14/en/tools/quicklook/summary.aspx?ra=11%2054%2048.85&dec=+24%2043%2033.0

I have this link in the kill-ring, mark 'some text' in an org-mode buffer
and run org-insert-link (C-c C-l).  Then I yank the link (C-y) in the
minibuffer, and hit enter twice (since the marked text is what I want
for the description).

Now, this is what I get in the org-mode buffer:
[[http://skyserver.sdss.org/dr14/en/tools/quicklook/summary.aspx?ra=11%252054%252048.85&dec=+24%252043%252033.0][some text]]

As you can see the %20 gets encoded again to %2520. %25 is the % sign
defined in RFC 3986. I think we run into the problem that is mentioned
in this RFC in Sect 2.4 https://tools.ietf.org/html/rfc3986  -
i.e. encoding an decoding the % sign in URIs when it is not required, as
the URI is already formed.

Th expected behavoiour would be that the link gets inserted as is.

I never noticed this strange (and likely wrong) "under the hood"
behaviour before, as the links work fine when I open them (C-c C-o or
clicking on them in org-mode), since they get decoded again, and passed
in the right way to the browser.  Also when pressing C-c C-l on such a
link it is displayed in its originally form in the minibuffer.
Moreover, also HTML export decodes the link to its originally form.

However, when exporting to ODT, no such decoding happens - and I got
malformed URL (i.e. with %2520 instead of %20) in my ODT document.

With best regards,
Christian Herenz

P.S. Please CC me in follow-up emails, as I am not subscribed to
the mailinglist.

-- 
------------------------------------------------------------------------
Edmund Christian Herenz            Office:  C6:1001
Stockholms universitet             E-Mail:  christian.herenz@astro.su.se
AlbaNova universitetscentrum       Phone:   +46 (0)85 537 8512
Institutionen för astronomi        Mobile:  +46 (0)73 670 5571
106 91 Stockholm                            
------------------------------------------------------------------------

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

* Re: Bug: HTTP links that contain %20 get malformed to %2520 - affects ODT export [9.2.1 (9.2.1-dist @ /home/ehere/emacs-scripts/org-9.2.1/lisp/)]
  2019-02-22  4:33 Bug: HTTP links that contain %20 get malformed to %2520 - affects ODT export [9.2.1 (9.2.1-dist @ /home/ehere/emacs-scripts/org-9.2.1/lisp/)] Edmund Christian Herenz
@ 2019-03-01 17:06 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2019-03-01 17:06 UTC (permalink / raw)
  To: Edmund Christian Herenz; +Cc: emacs-orgmode

Hello,

Edmund Christian Herenz <christian.herenz@astro.su.se> writes:

> Consider the following HTTP link:
> http://skyserver.sdss.org/dr14/en/tools/quicklook/summary.aspx?ra=11%2054%2048.85&dec=+24%2043%2033.0
>
> I have this link in the kill-ring, mark 'some text' in an org-mode buffer
> and run org-insert-link (C-c C-l).  Then I yank the link (C-y) in the
> minibuffer, and hit enter twice (since the marked text is what I want
> for the description).
>
> Now, this is what I get in the org-mode buffer:
> [[http://skyserver.sdss.org/dr14/en/tools/quicklook/summary.aspx?ra=11%252054%252048.85&dec=+24%252043%252033.0][some text]]
>
> As you can see the %20 gets encoded again to %2520. %25 is the % sign
> defined in RFC 3986. I think we run into the problem that is mentioned
> in this RFC in Sect 2.4 https://tools.ietf.org/html/rfc3986  -
> i.e. encoding an decoding the % sign in URIs when it is not required, as
> the URI is already formed.

It is not an issue per se. For historical reasons, Org needs to escape %
characters, and uses percent encoding to do so. So you have two layers
of percent encoding.
>
> Th expected behavoiour would be that the link gets inserted as is.

It does not work that way at the moment. However, that might change in
a next release. This is being discussed at the moment in this ML.

> However, when exporting to ODT, no such decoding happens - and I got
> malformed URL (i.e. with %2520 instead of %20) in my ODT document.

This should now be fixed. Thank you.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2019-03-01 17:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22  4:33 Bug: HTTP links that contain %20 get malformed to %2520 - affects ODT export [9.2.1 (9.2.1-dist @ /home/ehere/emacs-scripts/org-9.2.1/lisp/)] Edmund Christian Herenz
2019-03-01 17:06 ` 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).