Closed Robot-Inventor closed 6 months ago
If the heading already has an id set by another plugin, use it; otherwise, set the id.
ref: https://github.com/syntax-tree/mdast-util-toc/blob/c96a9eb446a8426b53cf2b68cf6655f3f2600420/lib/search.js#L96
Since Astro sets the id of the headings in rehype, it is not possible to get the id from the remark plugin.
id
ref: https://github.com/withastro/astro/blob/297571eb98509a63f894d6fff912775b637a1482/packages/markdown/remark/src/rehype-collect-headings.ts
If the heading already has an id set by another plugin, use it; otherwise, set the id.