[PR #56] [MERGED] Fixes problem with multiple, similar abbreviations not parsing correctly #790

Open
opened 2026-01-29 14:45:33 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/56
Author: @christophano
Created: 9/13/2016
Status: Merged
Merged: 9/14/2016
Merged by: @xoofx

Base: masterHead: bugfix/similar-abbreviations


📝 Commits (1)

  • d70f14a Fixes problem with multiple, similar abbreviations not parsing correctly.

📊 Changes

3 files changed (+42 additions, -6 deletions)

View changed files

📝 src/Markdig.Tests/Specs/AbbreviationSpecs.md (+12 -0)
📝 src/Markdig.Tests/Specs/Specs.cs (+24 -0)
📝 src/Markdig/Helpers/TextMatcher.cs (+6 -6)

📄 Description

When you have multiple, similar (when an abbreviation is a substring of another abbreviation) abbreviations then only the first abbreviation will be applied.
For example:

*[1A]: First
*[1A1]: Second
*[1A2]: Third
We can abbreviate 1A, 1A1 and 1A2!

should result in:

<p>We can abbreviate <abbr title="First">1A</abbr>, <abbr title="Second">1A1</abbr> and <abbr title="Third">1A2</abbr>!</p>

but instead we get:

<p>We can abbreviate <abbr title="First">1A</abbr>, 1A1 and 1A2!</p>

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/xoofx/markdig/pull/56 **Author:** [@christophano](https://github.com/christophano) **Created:** 9/13/2016 **Status:** ✅ Merged **Merged:** 9/14/2016 **Merged by:** [@xoofx](https://github.com/xoofx) **Base:** `master` ← **Head:** `bugfix/similar-abbreviations` --- ### 📝 Commits (1) - [`d70f14a`](https://github.com/xoofx/markdig/commit/d70f14addbcb3ebe3b7f7f37ee5ebd1446c8d688) Fixes problem with multiple, similar abbreviations not parsing correctly. ### 📊 Changes **3 files changed** (+42 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig.Tests/Specs/AbbreviationSpecs.md` (+12 -0) 📝 `src/Markdig.Tests/Specs/Specs.cs` (+24 -0) 📝 `src/Markdig/Helpers/TextMatcher.cs` (+6 -6) </details> ### 📄 Description When you have multiple, similar (when an abbreviation is a substring of another abbreviation) abbreviations then only the first abbreviation will be applied. For example: ``` md *[1A]: First *[1A1]: Second *[1A2]: Third We can abbreviate 1A, 1A1 and 1A2! ``` should result in: ``` html <p>We can abbreviate <abbr title="First">1A</abbr>, <abbr title="Second">1A1</abbr> and <abbr title="Third">1A2</abbr>!</p> ``` but instead we get: ``` html <p>We can abbreviate <abbr title="First">1A</abbr>, 1A1 and 1A2!</p> ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 14:45:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#790