marksman icon indicating copy to clipboard operation
marksman copied to clipboard

Support heading IDs

Open artempyanykh opened this issue 2 years ago • 4 comments

This is a non-standard feature https://www.markdownguide.org/extended-syntax/#heading-ids However it can be useful! For instance, docusaurus (docusaurus.io) understands custom heading IDs.

artempyanykh avatar Aug 07 '22 21:08 artempyanykh

In pandoc, any text (not just headings) can be decorated with an ID. For example:

- (200 pts) **[Practical exercises]{id="practical-exercises"}**

Could marksman support this?

reagle avatar Sep 22 '22 14:09 reagle

@reagle how does this work exactly? Is this [<text>]{id="<id>"} the syntax you need to use to decorate something with an id (basically, wrap it in a link-like thing)?

artempyanykh avatar Sep 22 '22 16:09 artempyanykh

Hi @artempyanykh.

Pandoc supports two extensions that I use, implicit header references on headings and bracketed spans elsewhere. Neither is in the core CommonMark specification, but bracketed spans are supported in djot, which I hope will become commonplace. I use both extensions and marksman gives warnings of missing targets. I thought there might be a way to turn off these warnings or perhaps it could support these extensions, which brought me to this issue. 😄

reagle avatar Sep 22 '22 17:09 reagle

@reagle thanks! I like the idea of supporting these extensions. I extracted each into its own issue.

artempyanykh avatar Sep 22 '22 19:09 artempyanykh