emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] non-standard link errors


From: Simon Thum
Subject: Re: [O] non-standard link errors
Date: Wed, 2 Mar 2016 10:11:11 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

Hi,

this reminds me of my issue with tel: links. I also would have preferred to have them exported "pass-through", but AFAICT this requires me to come up with a trival function for every possible backend: those I know, those I don't, and those that may not exist yet.

I cannot switch to the raw: solution (due to vcard export). I'm not currently experiencing problems, but I would like to suggest that maybe such a trival default handler could be added to the backends as some well-known property to be available to those who set the broken link handler to e.g. 'fallback. The onus would be on the user to do this, since correctness of output may suffer. Of course, basic sanitation should still be done in such a handler, but preferably no spectacular failure*.

Cheers,

Simon

(*) Because I sync using org exporter, I tend to suffer from those. And yes, I'd rather have wrong output I can diagnose than nothing.

On 02/29/2016 07:10 PM, Nicolas Goaziou wrote:
Hello,

Skip Collins <address@hidden> writes:

I have come up with a better solution than globally passing "broken"
links. I defined a new "raw" link type. So now if I want to put a
non-standard link in my export, I can do something like:
Here is a [[raw:foo:/\bar, baz][bad link]].
which is exported in html as:
Here is a <a href="foo:/\bar, baz">bad link</a>.

Now I can have non-standard links included in the output without
disabling link checking for all standard link types. This is how it is
defined in my .emacs:
(org-add-link-type "raw" 'org-raw-follow 'org-raw-export)
(defun org-raw-follow (path))
(defun org-raw-export (path desc format)
   "Export a raw link.
See `org-add-link-type' for details about PATH, DESC and FORMAT."
   (cond
    ((eq format 'html) (format "<a href=\"%s\">%s</a>" path desc))
    ((eq format 'latex) (format "\\href{%s}{%s}" path desc))
    ((eq format 'ascii) (format "%s (%s)" desc path))
    (t path)))

Perhaps this could be included in the standard Org distribution as a
fallback option for exporting non-standard link types. Emacs/Org does
nothing with the link. The user is responsible for ensuring the output
is correct.

This is already the default behavior for custom types. You don't even
need to use `org-raw-export' or `org-raw-open'. All is needed, is

  (org-add-link-type "raw")

Org requires it so it can tell if the link is an internal link or not.
However, I don't think we need to introduce a particular link type for
that. Users can define whatever they want.


Regards,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]