emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* why prepend "file://" to abs paths in html output?
@ 2017-07-08  0:38 Matt Price
  2017-07-08 10:33 ` Nicolas Goaziou
  0 siblings, 1 reply; 20+ messages in thread
From: Matt Price @ 2017-07-08  0:38 UTC (permalink / raw)
  To: Org Mode

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

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

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

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

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

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

end of thread, other threads:[~2017-07-13 13:15 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-08  0:38 why prepend "file://" to abs paths in html output? Matt Price
2017-07-08 10:33 ` Nicolas Goaziou
2017-07-08 12:37   ` Kaushal Modi
2017-07-08 14:08     ` Nicolas Goaziou
2017-07-08 14:19       ` Carsten Dominik
2017-07-08 19:13         ` Nicolas Goaziou
2017-07-08 23:37           ` Tim Cross
2017-07-09 10:45             ` Nicolas Goaziou
2017-07-10 12:53               ` Kaushal Modi
2017-07-10 13:31                 ` Nicolas Goaziou
2017-07-10 13:58               ` Brett Viren
2017-07-10 19:54                 ` Kaushal Modi
2017-07-10 21:44                   ` Kaushal Modi
2017-07-13 12:39                   ` Nicolas Goaziou
2017-07-13 12:50                     ` Kaushal Modi
2017-07-13 12:55                       ` Nicolas Goaziou
2017-07-13 13:01                         ` Kaushal Modi
2017-07-13 13:14                           ` Nicolas Goaziou
2017-07-13 12:46                 ` Nicolas Goaziou
2017-07-10 22:12               ` Tim Cross

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