emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org links, URLs and HTML export
@ 2016-08-22 22:28 Fabrice Popineau
  2016-08-23 16:30 ` Achim Gratz
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Popineau @ 2016-08-22 22:28 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

Hi,

I'm puzzled by the following.
I write a couple of Org file with HTML export in mind, building a site with
several pages, say:
foo.org -> foo.html
bar.org -> bar.html
I want to insert a link in foo.org that will point to bar.html when
exported.

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="http:/bar.html"></a>
The corresponding export should be <a href="/bar.html"></a>

Strangely, some browsers grok the former (Chrome), but not all of them
(Safari).
Anyway, only the later is correct.

Is there any way to fix exporting relative urls?

If I'm wrong somewhere, please correct me.

Best regards,

Fabrice

[-- Attachment #2: Type: text/html, Size: 1200 bytes --]

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

* Re: Org links, URLs and HTML export
  2016-08-22 22:28 Org links, URLs and HTML export Fabrice Popineau
@ 2016-08-23 16:30 ` Achim Gratz
  2016-08-23 16:57   ` Fabrice Popineau
  0 siblings, 1 reply; 3+ messages in thread
From: Achim Gratz @ 2016-08-23 16:30 UTC (permalink / raw)
  To: emacs-orgmode

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 <a href="http:/bar.html"></a>
> The corresponding export should be <a href="/bar.html"></a>

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.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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

* Re: Org links, URLs and HTML export
  2016-08-23 16:30 ` Achim Gratz
@ 2016-08-23 16:57   ` Fabrice Popineau
  0 siblings, 0 replies; 3+ messages in thread
From: Fabrice Popineau @ 2016-08-23 16:57 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode@gnu.org

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

2016-08-23 18:30 GMT+02:00 Achim Gratz <Stromeko@nexgo.de>:

> 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 <a
> href="http:/bar.html"></a>
> > The corresponding export should be <a href="/bar.html"></a>
>
> 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 <a href="http:/bar.html"> is wrong.

I guess I can solve that with a filter.

Greetings,

Fabrice

[-- Attachment #2: Type: text/html, Size: 2849 bytes --]

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

end of thread, other threads:[~2016-08-23 16:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-22 22:28 Org links, URLs and HTML export Fabrice Popineau
2016-08-23 16:30 ` Achim Gratz
2016-08-23 16:57   ` Fabrice Popineau

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