emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sebastien Delafond <sdelafond@gmx.net>
To: emacs-orgmode@gnu.org
Subject: Links with description and '%3f' in URL fail
Date: Thu, 4 Mar 2010 16:06:04 +0000 (UTC)	[thread overview]
Message-ID: <20100304170052.734@usenet.piggo.com> (raw)

Quoting from debian bug report #572404[0]:

  This error is quite esoteric.  Creating a link with a '%3f' escape
  sequence in its URL (at least HTTP ones) makes it fail to be edited
  with C-c C-l and exported with the error:

    org-link-unescape: Wrong type argument: characterp, nil

  But only if the link has a description.  Other escape sequences like
  '%3e' or '%40' or even the literal '?' corresponding to character 0x3f
  don't trigger the error.  For instance:

  - http://www.example.com/x%3fx  doesn't trigger the error
  - [[http://www.example.com/x%3fx][test]]  triggers the error
  - [[http://www.example.com/x%3ex][test]]  doesn't trigger the error
  - [[http://www.example.com/x?x][test]]  doesn't trigger the error

  Even more strange, while '%3f' reveals the error, '%3F' does not.  I
  guess the ``org-link-unescape`` function has some serious problems
  with the handling of '?': when using '%3F' in an HTTP URL, it is
  unescaped when exported to HTML, resulting most of the time in invalid
  URLs, since the '?' character separates the path from query arguments.

  For instance, in "http://x.org/what%3F" the '%3F' should be left as is
  instead of being exported as "http://x.org/what?".  In
  "http://x.org/query?foo=bar", the '?' should also be left as is.

  Here it's better to trust the user and leave URLs untouched than
  trying to be too smart.

It at least sounds a like strange that it'd behave diffrently depending
on whether or not there is a description alongside the link...

Cheers,

--Seb

[0] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572404

             reply	other threads:[~2010-03-04 16:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04 16:06 Sebastien Delafond [this message]
2010-03-04 20:51 ` Links with description and '%3f' in URL fail Carsten Dominik
2010-03-05 10:00   ` Sebastien Delafond
2010-03-05 12:37     ` Carsten Dominik

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=20100304170052.734@usenet.piggo.com \
    --to=sdelafond@gmx.net \
    --cc=emacs-orgmode@gnu.org \
    /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).