mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
[Help] Understanding of InlineParser Implementations #638
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @khalidabuhakmeh on GitHub (Oct 27, 2023).
👋 Hi @xoofx,
Thanks for offering help. My mental model is off somewhere, but I need to figure out where. The functionality of this parser isn't as important as understanding the process around
StringSlice, which I find confusing when looking at other examples.Given the following markdown, I expect the following result.
with the result.
Instead, I get this. You'll notice the text
this is a link toandanotheris missing from the final output. I'm not sure what I'm doing wrong. If I had to guess, I'm skipping the text, but other processors would handle that.My current implementation is below. No rush. I'm trying to write a blog post about this subject because I find it fascinating, and this is a great library. Cheers :)
@xoofx commented on GitHub (Oct 27, 2023):
I don't know if it is the only reason, but you are missing declaring the opening character for your inline parser (e.g like here)
Without it, I don't recall the details, but it might not work at all.
@khalidabuhakmeh commented on GitHub (Oct 27, 2023):
🤦 That fixed it. I'm a dummy. I appreciate your help.
Now, the parser only starts when it sees an opening character
[, which is the expected behavior. Previously, it sent the entire text block, which is too much.