On 07/09/2026 12:24 pm, Ihor Radchenko wrote:
Khalid Rafi writes:

=ox-md= currently can't export links like ~path::#custom-id~. But, I
think it's a very expected behavior to export such links as
~path#custom-id~ which is known as anchor links. I'm not sure why this
case was left alone.
[...]
No details provided.
Canceled.

My guess is that export of

    [[file:another.org::#another_h][custom ID link]]

drops the anchor withing the target file

    [custom ID link](another.md)

and expectations are to get something more close to HTML where the search part of the link is preserved

    <a href="another.html#another_h">custom ID link</a>

(when `org-html-prefer-user-labels' is enabled).

Flavors of markdown are out of scope of my expertise, but it seems original format does not have a native way to specify anchors. There are extensions like pandoc's attributes

    # Another file heading {#another_h}

and GitHub's convention to derive anchors from section titles (#another-file-heading). I am unsure concerning portability of the approach with raw HTML inside .md files. It may be stripped by some engines.

When anchors are not defined, there is no point to add fragment identifiers to links.

3rd party ox packages for markdown flavors might support CUSTOM_ID/anchors for more precise links. For ox-md.el it looks like a limitation of the format.

Reply via email to