[PR #60] [MERGED] Fixes issue where punctuation forms part of word, so abbreviation is not valid #797

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

📋 Pull Request Information

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

Base: masterHead: bugfix/abbreviation-preceded-by-punctuation


📝 Commits (1)

  • a9b626e Fixes issue where punctuation forms part of word, so abbreviation is not valid.

📊 Changes

3 files changed (+67 additions, -12 deletions)

View changed files

📝 src/Markdig.Tests/Specs/AbbreviationSpecs.md (+10 -0)
📝 src/Markdig.Tests/Specs/Specs.cs (+22 -0)
📝 src/Markdig/Extensions/Abbreviations/AbbreviationParser.cs (+35 -12)

📄 Description

I've had an issue where abbreviations are being created for words that contain punctuation.
Example:

*[1A]: First
We should not abbreviate 1.1A

Is rendered as:

<p>We should not abbreviate 1.<abbr title="First">1A</abbr></p>

I've adjusted the AbbreviationParser to allow punctuation to embrace matches only if they are further embraced by \0 or whitespace.


🔄 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/60 **Author:** [@christophano](https://github.com/christophano) **Created:** 9/20/2016 **Status:** ✅ Merged **Merged:** 9/20/2016 **Merged by:** [@xoofx](https://github.com/xoofx) **Base:** `master` ← **Head:** `bugfix/abbreviation-preceded-by-punctuation` --- ### 📝 Commits (1) - [`a9b626e`](https://github.com/xoofx/markdig/commit/a9b626e81056bff740398cf7bc371589da3c281e) Fixes issue where punctuation forms part of word, so abbreviation is not valid. ### 📊 Changes **3 files changed** (+67 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig.Tests/Specs/AbbreviationSpecs.md` (+10 -0) 📝 `src/Markdig.Tests/Specs/Specs.cs` (+22 -0) 📝 `src/Markdig/Extensions/Abbreviations/AbbreviationParser.cs` (+35 -12) </details> ### 📄 Description I've had an issue where abbreviations are being created for words that contain punctuation. Example: ``` md *[1A]: First We should not abbreviate 1.1A ``` Is rendered as: ``` html <p>We should not abbreviate 1.<abbr title="First">1A</abbr></p> ``` I've adjusted the `AbbreviationParser` to allow punctuation to embrace matches only if they are further embraced by \0 or whitespace. --- <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:39 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#797