Skip to content

How do I get my parser to work by matching this very particular MarkDown? #1028

Closed Answered by colinodell
inuitviking asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there! 👋

It looks like your Markdown syntax is already recognized and easily parsed by this library - it's just an image inside of a link. Instead of trying to write your own parser (that needs to compete with the built-in ones), it would be much easier to find and modify the parsed elements.

See these docs on how to iterate and modify the parsed elements and this example of how to hook that logic up to the engine.

In your case, it looks like you'll want to find any Link containing a single Image child whose Text is one of those four strings. You can then choose to modify or completely replace any/all of those elements as needed.

Hope that helps!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by inuitviking
Comment options

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