Skip to content

How to place own transformer before gfm autolink transforms text into link? #57

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

You must be logged in to vote

My Markdown looks like this:

beginning ![image alt](https://image "url" extra) end

this isn' a valid markdown image, there is no content after title in markdown links or images.

What am I missing about how plugins work?

Parsing happens first thing, and as a single step.
Stringifying happens last and also as a signle step.
Parsing and stringifying plugins, like remark-gfm, add functionality to the step, but don't add new steps.

Is it possible to have my plugin be called before the gfm plugin gets to transform the AST?

no, see the above on how parser plugins work.

If that is not possible, is there a robust [... add] a customised image node?

You could write a custom parser for your c…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
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