[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature request: Allow export to convert broken links to plain text
From: |
Berry, Charles |
Subject: |
Re: Feature request: Allow export to convert broken links to plain text |
Date: |
Mon, 11 Sep 2023 17:12:23 +0000 |
Ryan,
> On Sep 9, 2023, at 9:13 PM, Ryan C. Thompson <rct@thompsonclan.org> wrote:
>
> So, this isn't an ideal solution, since it requires me to prefix any
> potential offending links with "maybe:". But it's good enough for me.
>
It is good that you have a solution, albeit with the caveat you mention above.
A couple of thoughts:
There is a hook that operates on the copy buffer before parsing viz.
"org-export-before-parsing-functions is a variable defined in ‘ox.el’." (In
older versions, it was org-export-before-parsing-hook.) Maybe you can add a
hook that will add that prefix to all links, so you do not need to put it in
your working files.
Or you could write an elisp macro that takes two arguments (link, desc) and
uses them to either construct a link or your preferred substitute if it fails
validation.
HTH,
Chuck