From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: why prepend "file://" to abs paths in html output? Date: Fri, 7 Jul 2017 20:38:12 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1149a23294b2f70553c3906b" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTdlI-0005jW-85 for emacs-orgmode@gnu.org; Fri, 07 Jul 2017 20:38:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTdlH-0003gq-Dz for emacs-orgmode@gnu.org; Fri, 07 Jul 2017 20:38:16 -0400 Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]:36323) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dTdlH-0003fW-9x for emacs-orgmode@gnu.org; Fri, 07 Jul 2017 20:38:15 -0400 Received: by mail-qk0-x229.google.com with SMTP id p21so39967096qke.3 for ; Fri, 07 Jul 2017 17:38:13 -0700 (PDT) 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: Org Mode --001a1149a23294b2f70553c3906b Content-Type: text/plain; charset="UTF-8" in org-html-link local links of the form "/some/path/to/file" are rewritten as "file:///some/path/to/file". This makes it difficult to write root-relative URL's in the way that one might expect to be able to (so that export produces links like Is this really the most desirable behaviour? In html export, at least, I would think most users would want to allow links of the kind I described. But this seems like a conscious design decision; cf. these lines from org-html-link: ;; If file path is absolute, prepend it with protocol ;; component - "file://". (cond ((file-name-absolute-p raw-path) (setq raw-path (org-export-file-uri raw-path))) ((and home use-abs-url) (setq raw-path (concat (file-name-as-directory home) raw-path)))) I'm wondering whether a user oculd at least set a defcustom to control this behaviour. Thanks, Matt --001a1149a23294b2f70553c3906b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
in org-html-link local links of the form

"/some/path/to/file"

<= div>are rewritten as

"file:///some/path/= to/file".=C2=A0

This makes it difficult = to write root-relative URL's in the way that one might expect to be abl= e to (so that export produces links like

<= img src=3D"/static/images/unicorn.jpg"/>

<= div>Is this really the most desirable behaviour? In html export, at least, = I would think most users would want to allow links of the kind I described.= But this seems like a conscious design decision; cf. these lines from org-= html-link:

=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ;= ; If file path is absolute, prepend it with protocol
=C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0 ;; component - "file://".
=C2=A0=C2=A0=C2= =A0 =C2=A0=C2=A0=C2=A0 (cond
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0= ((file-name-absolute-p raw-path)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (setq raw-path (org-export-file-uri raw-path)))
=C2=A0=C2= =A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 ((and home use-abs-url)
=C2=A0=C2=A0= =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (setq raw-path (concat (file-name-as-= directory home) raw-path))))

I'm wondering= whether a user oculd at least set a defcustom to control this behaviour.

Thanks,
Matt

--001a1149a23294b2f70553c3906b--