Max Nikulin <[email protected]> writes:

>> When exporting, we will pre-process all the nested links and only the
>> links that are (a) a sole contents element of the parent link
>> description; (b) are images.
>
> (b) is inconsistent with generic preview framework where other types of 
> links (besides images) may define custom overlays. Perhaps :export 
> function should know whether it called for a nested link, so it should 
> not generate active link, or it is regular "standalone" link.

Currently, nested links are handled by export via
`org-export-insert-image-links', which makes use of
`org-export-default-inline-image-rule'
This is the same rule as the one used to detect standalone links.
So, we do not currently distinguish between these two types of
links. Whether we should is debatable, but such debate would be
orthogonal to parsing nested links.

In any case, :export function might be able to check for nested links if
we pass it a link object, as discussed in another thread about :export.
So, this is not something unsolvable.

> Difference between
> [[https://orgmode.org][file:image directory/unicorn.svg]]
> and
> [[https://orgmode.org][<file:image directory/unicorn.svg>]]
> may be too subtle (notice a space in the image path).

This is no different now, if we limit things to exporter.
So, I also view this problem as rather orthogonal.

> I can not estimate consequences for 3rd party packages that invokes 
> parser to handle user commands. They must be updated to ignore nested 
> links. I do not know where handling of special cases is more painful.

I do not see consequences as catastrophic in this scenario. Maybe it is
because it saw way too many places in Org codebase that have to parse
these nested links manually. Link inside link is not conceptually too
different from link inside some other kind of markup (e.g. bold).

Could you think of examples when packages may be broken?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to