From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Popineau Subject: Re: Org links, URLs and HTML export Date: Tue, 23 Aug 2016 18:57:03 +0200 Message-ID: References: <87k2f7v45x.fsf@Rainer.invalid> Reply-To: fabrice.popineau@centralesupelec.fr Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113cf42c08ba1d053ac00fc1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcF14-000800-3G for emacs-orgmode@gnu.org; Tue, 23 Aug 2016 12:57:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcF0z-00044S-45 for emacs-orgmode@gnu.org; Tue, 23 Aug 2016 12:57:33 -0400 Received: from smtp2.supelec.fr ([160.228.120.31]:36765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcF0y-00043Q-Hp for emacs-orgmode@gnu.org; Tue, 23 Aug 2016 12:57:29 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp2.supelec.fr (Postfix) with ESMTP id 936E980183 for ; Tue, 23 Aug 2016 18:57:25 +0200 (CEST) Received: from smtp2.supelec.fr ([127.0.0.1]) by localhost (smtp2.supelec.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6GeWc7wygFIG for ; Tue, 23 Aug 2016 18:57:25 +0200 (CEST) Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com [209.85.218.43]) by smtp2.supelec.fr (Postfix) with ESMTPSA id 04E7A8015F for ; Tue, 23 Aug 2016 18:57:25 +0200 (CEST) Received: by mail-oi0-f43.google.com with SMTP id c15so204236055oig.0 for ; Tue, 23 Aug 2016 09:57:24 -0700 (PDT) In-Reply-To: <87k2f7v45x.fsf@Rainer.invalid> 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" To: Achim Gratz Cc: "emacs-orgmode@gnu.org" --001a113cf42c08ba1d053ac00fc1 Content-Type: text/plain; charset=UTF-8 2016-08-23 18:30 GMT+02:00 Achim Gratz : > Fabrice Popineau writes: > > I can insert : [[http:bar.html]] > > However, I would like to be able to insert any kind of relative url. > > Specifically, there is no mean to insert something > > like : [[http:/bar.html]] which is exported to href="http:/bar.html"> > > The corresponding export should be > > But that's an absolute URL, provided a well-defined base URI exists (the > authority is implied and the path component starts with a slash, so it > would start in the root). > > > Strangely, some browsers grok the former (Chrome), but not all of them > > (Safari). > > Then Safari either has a bug or it determines the base URI differently > than Chrome. > > > Anyway, only the later is correct. > > I don't think so. You might want to read > > https://tools.ietf.org/html/rfc3986 > > specifically the part about the translation of relative URI. > > Thanks for the pointer. It helps because it states that: "Some parsers allow the scheme name to be present in a relative reference if it is the same as the base URI scheme. This is considered to be a loophole in prior specifications of partial URI [RFC1630]. Its use should be avoided but is allowed for backward compatibility." And on page 21: "If the URI scheme defines a default for host, then that default applies when the host subcomponent is undefined or when the registered name is empty (zero length). For example, the "file" URI scheme is defined so that no authority, an empty host, and "localhost" all mean the end-user's machine, whereas the "http" scheme considers a missing authority or empty host invalid." So exporting to is wrong. I guess I can solve that with a filter. Greetings, Fabrice --001a113cf42c08ba1d053ac00fc1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


2016-08-23 18:30 GMT+02:00 Achim Gratz <Stromeko@nexgo.de>:
F= abrice Popineau writes:
> I can insert : [[http:bar.html]]
> However, I would like to be able to insert any kind of relative url. > Specifically, there is no mean to insert something
> like : [[http:/bar.html]] which is exported to <a href=3D"http= :/bar.html"></a>
> The corresponding export should be <a href=3D"/bar.html"&= gt;</a>

But that's an absolute URL, provided a well-defined base URI exi= sts (the
authority is implied and the path component starts with a slash, so it
would start in the root).

> Strangely, some browsers grok the former (Chrome), but not all of them=
> (Safari).

Then Safari either has a bug or it determines the base URI different= ly
than Chrome.

> Anyway, only the later is correct.

I don't think so.=C2=A0 You might want to read

https://tools.ietf.org/html/rfc3986

specifically the part about the translation of relative URI.

Thanks for the pointer.=C2=A0
It helps beca= use it states that:

"Some parsers allow the s= cheme name to be present in a relative
=C2=A0 =C2=A0reference if = it is the same as the base URI scheme.=C2=A0 This is
=C2=A0 =C2= =A0considered to be a loophole in prior specifications of partial URI
=
=C2=A0 =C2=A0[RFC1630].=C2=A0 Its use should be avoided but is allowed= for backward
=C2=A0 =C2=A0compatibility."

And on page 21:

"If the URI scheme de= fines a default for host, then that default
=C2=A0 =C2=A0applies = when the host subcomponent is undefined or when the
=C2=A0 =C2=A0= registered name is empty (zero length).=C2=A0 For example, the "file&q= uot; URI
=C2=A0 =C2=A0scheme is defined so that no authority, an = empty host, and
=C2=A0 =C2=A0"localhost" all mean the e= nd-user's machine, whereas the "http"
=C2=A0 =C2=A0= scheme considers a missing authority or empty host invalid."

So exporting to <a href=3D"http:/bar.html">= is wrong.

I guess I can solve that with a filter.=

Greetings,

Fabrice
=


--001a113cf42c08ba1d053ac00fc1--