weblorg icon indicating copy to clipboard operation
weblorg copied to clipboard

Generated heading IDs are not unique

Open thecashewtrader opened this issue 2 years ago • 1 comments

The id generated for each heading is not unique. Example: https://thecashewtrader.gitlab.io/braindump/antilinks All the "Alternatives" headings have the same id i.e #alternatives

thecashewtrader avatar Apr 22 '22 14:04 thecashewtrader

Are the links to the "Alternatives" headings internal links? If so, this may be undefined behaviour as looking at the org mode docs for internal links, there's explicit mention of:

Note that you must make sure custom IDs, dedicated targets, and names are unique throughout the document.

It could potentially be possible to address this by changing how the headline slugs are generated for headlines without a CUSTOM_ID by appending the :begin property value of the headline to the slug since the start position of a headline within an org document should be unique.

nanzhong avatar Dec 29 '23 19:12 nanzhong