Skip to content

How to add new node type to the AST for [[_TOC_]] and [[_TOSP_]] ? #1258

Answered by ChristianMurphy
doggy8088 asked this question in Q&A
Discussion options

You must be logged in to vote

Welcome @doggy8088! 👋

How to add new node type to the AST for [[TOC]] and [[TOSP]] ?

It is possible, though generally not recommended to create yet another markdown flavor (https://github.com/micromark/micromark#extending-markdown)
If you do want to add token type/AST node, see https://github.com/micromark/micromark#creating-a-micromark-extension
And draw some inspiration from https://github.com/landakram/remark-wiki-link


An alternative would be nudging Azure/Microsoft toward using standard markdown directives https://github.com/remarkjs/remark-directive#readme, instead of creating another markdown flavor.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@doggy8088
Comment options

@ChristianMurphy
Comment options

Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants