text icon indicating copy to clipboard operation
text copied to clipboard

Support custom heading-ids and overriding heading id prefix

Open benniekiss opened this issue 7 months ago • 1 comments

Is your feature request related to a problem? Please describe. Currently, heading IDs are prefixed with an h-, implemented here, https://github.com/nextcloud/text/pull/3795, to address naming conflicts reported for headings with Nextcloud, and maybe others.

Rendering does not seem to respect or register custom heading IDs via the {#heading-id} syntax, https://www.markdownguide.org/extended-syntax/#heading-ids.

This way of working around naming conflicts breaks link rendering in my markdown editor when I do local editing (vscodium editor). Because the prefix is hardcoded and custom ids are not respected, I cannot utilize the inter-document links in both editors. I have to chose one or the other, losing functionality either way.

Describe the solution you'd like Supporting custom heading ids would allow me to set consistent heading links across my editors and allow me to manually address naming conflicts that work with my documents.

Describe alternatives you've considered Accept the broken links.

benniekiss avatar Jun 04 '25 15:06 benniekiss

That is an interesting proposal, i have not seen this kind of syntax anywhere yet.

We so far try to mostly stick to commonmark as a standard, but already have some custom additions to it.

https://talk.commonmark.org/t/anchors-in-markdown/247/36 and https://talk.commonmark.org/t/consistent-attribute-syntax/272 are interesting related discussions around that.

Thanks for your suggestion there, this is something that probably needs a bit more consideration and is currently not on our priority list, but if anyone wants to contribute to this feature we are open to that of course.

juliusknorr avatar Jun 05 '25 11:06 juliusknorr