content
content copied to clipboard
Give option to set parsing order of Remark Plugins
Is your feature request related to a problem? Please describe
Issue encountered in https://github.com/Atinux/content-wind/issues/6#issuecomment-1213299468
Currently, the remark-mdc plugin is parsed first, and then any other custom plugin.
This happens even when in nuxt.config.ts:
markdown: {
remarkPlugins: ['custom-plugin', '@docus/remark-mdc'],
mdc: false
}
Note: Here, '@docus/remark-mdc' is manually added last in remarkPlugins array. Still, it is parsed first.
So, this markdown

becomes
With MDC enabled (by default)

With MDC disabled

So, inside the custom remark plugin, it becomes difficult to target [[... type of text, e.g., wiki-links or ![[..., e.g., embed/attachments/transclusions.
So, the issue is I can either use my custom plugin or the remark-mdc, but not both together.
Describe the solution you'd like
The Module should parse the remark plugins based on the order they are present in the array of remarkPlugins. Don't give priority to mdc plugin. Parse it as last remark plugin.
Describe alternatives you've considered
Disable mdc, i.e., set it to false. Then, use the custom remark plugin. But this prevents me from using mdc at all.
Additional context
Thanks for your issue @ManasMadrecha
I think that MDC should ignore the [[ or ![[ syntax directly ☺️
Fixed in remark-mdc package and soon will be available on the edge channel
@farnabaz @Atinux Not yet fixed in edge channel. The remark-mdc doesn't ignore the [[ or ![[ which makes it very difficult to convert them to links using custom-plugin. It still converts them into span.
Kindly reopen the issue.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.
.