mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-15 05:55:41 +00:00
[PR #836] [MERGED] Fix an error in the AbbreviationParser. #1242
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?
📋 Pull Request Information
Original PR: https://github.com/xoofx/markdig/pull/836
Author: @snnz
Created: 12/18/2024
Status: ✅ Merged
Merged: 12/19/2024
Merged by: @xoofx
Base:
master← Head:fix-abbreviation📝 Commits (3)
5e4a917Fixes an error in the AbbreviationParser.2cff6c5It's necessary to keep a copy of the original literal.Span.End, because otherwise it is just lost in some cases.bc41b0cExisting test has been extended.📊 Changes
2 files changed (+7 additions, -2 deletions)
View changed files
📝
src/Markdig.Tests/TestSourcePosition.cs(+5 -1)📝
src/Markdig/Extensions/Abbreviations/AbbreviationParser.cs(+2 -1)📄 Description
The modified end of the previous literal is assigned to the literal next to abbrevion. The test of the abbreviations in TestSourcePosition.cs passes only because there is an abbreviation at the end of the string, and thus no literal remains after it. But add some literals after the abbreviation, say, a period '.', and instead of expected literal with the span 103-103 there will be one with the end less then the start (103-98).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.