Abbreviation matching #265

Closed
opened 2026-01-29 14:32:12 +00:00 by claunia · 3 comments
Owner

Originally created by @MihaZupan on GitHub (Jan 26, 2019).

I've been looking at the AbbreviationParser and came accross this discrepancy between different versions.

As a side-note, markdig currently doesn't match at all in cases like this due to how the TextMatchHelper works internally.

I'd be happy to fix this, just wanted to hear your thoughts on the commonmark issue first.

Originally created by @MihaZupan on GitHub (Jan 26, 2019). I've been looking at the `AbbreviationParser` and came accross this [discrepancy](https://talk.commonmark.org/t/abbreviations-longest-shortest-valid-match/3060) between different versions. As a side-note, markdig currently doesn't match at all in cases like [this](https://babelmark.github.io/?text=*%5BFoo%5D%3A+foo%0A*%5BFoo+Bar%5D%3A+foobar%0A%0AFoo+B) due to how the `TextMatchHelper `works internally. I'd be happy to fix this, just wanted to hear your thoughts on the commonmark issue first.
claunia added the enhancementPR Welcome! labels 2026-01-29 14:32:12 +00:00
Author
Owner

@xoofx commented on GitHub (Jan 27, 2019):

You can go ahead with what you think is more relevant/safe/consistent. The TextMatchHelper is one of the helper classes that would definitely need to be revisited 👍

@xoofx commented on GitHub (Jan 27, 2019): You can go ahead with what you think is more relevant/safe/consistent. The `TextMatchHelper` is one of the helper classes that would definitely need to be revisited 👍
Author
Owner

@MihaZupan commented on GitHub (Feb 6, 2019):

I've written a version of TextMatchHelper as a CompactPrefixTree.
Would you prefer I port it to markdig and add it as a helper class or add a NuGet reference (cross targets all platforms Markdig does)?

@MihaZupan commented on GitHub (Feb 6, 2019): I've written a version of TextMatchHelper as a [CompactPrefixTree](https://github.com/MihaZupan/SharpCollections). Would you prefer I port it to markdig and add it as a helper class or add a NuGet reference (cross targets all platforms Markdig does)?
Author
Owner

@xoofx commented on GitHub (Feb 6, 2019):

Would you prefer I port it to markdig and add it as a helper class or add a NuGet reference (cross targets all platforms Markdig does)?

Yeah, you can port it, I would like to avoid any dependencies.

@xoofx commented on GitHub (Feb 6, 2019): > Would you prefer I port it to markdig and add it as a helper class or add a NuGet reference (cross targets all platforms Markdig does)? Yeah, you can port it, I would like to avoid any dependencies.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#265