Closed rachmari closed 2 years ago
Hi Rachael! Thank you :)
remark-heading-id
is a community project, so it could definitely be a bug there. From a glance at the code though, it looks fine.
runbefore
is a hubdown option, so thatβs more a thing for @zeke. However, from a glance at the code it seems that runbefore
should be an array of things: where each thing is either a single plugin, or an array where the first thing is a plugin, and the second the options. That leads me to believe that the following might work:
runBefore: [
[remarkCodeExtra, { transform: codeHeader }],
remarkHeadingId
]
@wooorm thank you so much! This is super helpful. I'm very new to the Unified.js ecosystem. πββοΈ I'll give that a try!
@wooorm Zeke forwarded me to you as the maintainer of remark and the Unified.js ecosystem. The docs provided for Unified.js are excellent! π I'm testing out adding an extension and also looking at writing a new extension, and I'm running into some issues. Can you confirm if this is a bug in the extension or hubdown?
I'm testing out the
remark-heading-id
extension and it seems that the placement of the extension in therunBefore
list determines whether it works or not.When the
remark-heading-id
extension is listed first in this pull request, the extension works:When it's not listed first, the custom id is rendered as part of the heading: