On 09/08/2025 15:37, Ihor Radchenko wrote:
that had issues with exporting links like
[[info:emacs#Echo%20Area][info:emacs#Echo Area]]
However, we are getting way too many special cases all over the code by
now. Maybe, after all, it is a better idea to bring back the nested
links, and remove the nesting just for the purposes of exporter
Max Nikulin writes:
I do not think that general case of nested links should be supported.
Could you elaborate why?
Effect of nested link is confusing. Users may be in doubts what link
should be activated, borders between links may be hidden. Nested links
are not allowed in HTML:
<https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a#technical_summary>
However maybe you are right. Nested links may be parsed, but `org-lint'
may warn users.
I am unsure what should be inner link from the old bug report. Are you
going to parse it as invalid "info:emacs#Echo". Users should have enough
links with similar descriptions created by `org-store-link' +
`org-insert-link'.
Image path as link description is a quite specific kind of links. E.g.
there should be no other objects in the description.
It is technically easier to modify the parser to allow arbitrary link
objects in description vs. just image links specifically.
Also, with extendable preview system that Karthik contributed, any kind
of link might be previewable.
It is unclear to me how you are going to remove nesting for export
backends to avoid invalid documents generated by backends unaware that
links may be nested.
Perhaps images as objects to export should be introduced in ox. The
challenge is to do it in a backward compatible way (including derived
backends).