From: Simon Thum <simon.thum@gmx.de>
To: Skip Collins <skip.collins@gmail.com>,
emacs-org list <emacs-orgmode@gnu.org>,
Nicolas Goaziou <n.goaziou@gmail.com>
Subject: Re: non-standard link errors
Date: Wed, 2 Mar 2016 10:11:11 +0100 [thread overview]
Message-ID: <56D6AE2F.8000103@gmx.de> (raw)
In-Reply-To: <87wppnz8th.fsf@nicolasgoaziou.fr>
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 <skip.collins@gmail.com> 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,
>
next prev parent reply other threads:[~2016-03-02 9:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-26 18:25 non-standard link errors Skip Collins
2016-02-26 21:56 ` Nicolas Goaziou
2016-02-27 18:23 ` Skip Collins
2016-02-28 8:28 ` Nicolas Goaziou
2016-02-29 4:04 ` Skip Collins
2016-02-29 18:10 ` Nicolas Goaziou
2016-03-02 9:11 ` Simon Thum [this message]
2016-03-02 9:28 ` Nicolas Goaziou
2016-03-02 10:46 ` Simon Thum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56D6AE2F.8000103@gmx.de \
--to=simon.thum@gmx.de \
--cc=emacs-orgmode@gnu.org \
--cc=n.goaziou@gmail.com \
--cc=skip.collins@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).