Custom link formatter #1179
-
Hi there! I have a string like this: I need to parse this, and transform into a link. However, whenever I run my plugin alongside remark-gfm, it runs before it and parses as Ordering of plugins doesn't matter (I use Any help would be GREATLY appreciated! I just want my plugin to run before remark gfm parses stuff. <ReactMarkdown remarkPlugins={[myCustomPlugin, remarkGfm]}>check out !community@lemmy.world</ReactMarkdown> |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Welcome @aeharding! For context see the You could create your own parser plugin, but it is advisable not to for user/author experience purposes, see https://github.com/micromark/micromark#extending-markdown |
Beta Was this translation helpful? Give feedback.
Welcome @aeharding!
For context see the
unified
architecture. (https://github.com/unifiedjs/unified#description)remark-gfm
is a parser, it will always run before a transformer plugin, which is what I assumemyCustomPlugin
is.You could create your own parser plugin, but it is advisable not to for user/author experience purposes, see https://github.com/micromark/micromark#extending-markdown
As an alternative, consider using directives, which are semi-standard and pre-built https://github.com/remarkjs/remark-directive