[PR #357] [MERGED] Ignore backslashes in GFM AutoLinks #968

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

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/357
Author: @MihaZupan
Created: 7/16/2019
Status: Merged
Merged: 7/17/2019
Merged by: @xoofx

Base: masterHead: master


📝 Commits (1)

  • 033ddaf Ignore backticks in GFM AutoLinks

📊 Changes

2 files changed (+25 additions, -15 deletions)

View changed files

📝 src/Markdig.Tests/MiscTests.cs (+10 -0)
📝 src/Markdig/Helpers/LinkHelper.cs (+15 -15)

📄 Description

Fixes #356

The cause for the last character disappearing stems from this span calculation that uses link.Length even though backticks could be removed from the string.
This honors the difference between links and autolinks as stated in CommonMark and does not allow backtick escaping in automatic autolinks.

Edit: I meant backslash, not backtick


🔄 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/357 **Author:** [@MihaZupan](https://github.com/MihaZupan) **Created:** 7/16/2019 **Status:** ✅ Merged **Merged:** 7/17/2019 **Merged by:** [@xoofx](https://github.com/xoofx) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`033ddaf`](https://github.com/xoofx/markdig/commit/033ddaf6a8466a89f0d11e65fe6742a3e159f72e) Ignore backticks in GFM AutoLinks ### 📊 Changes **2 files changed** (+25 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig.Tests/MiscTests.cs` (+10 -0) 📝 `src/Markdig/Helpers/LinkHelper.cs` (+15 -15) </details> ### 📄 Description Fixes #356 The cause for the last character disappearing stems from [this span calculation](https://github.com/lunet-io/markdig/blob/master/src/Markdig/Extensions/AutoLinks/AutoLinkParser.cs#L170) that uses `link.Length` even though backticks could be removed from the string. This honors the difference between links and autolinks as stated [in CommonMark](https://spec.commonmark.org/0.29/#example-306) and does not allow backtick escaping in automatic autolinks. Edit: I meant **backslash**, not backtick --- <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:47:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#968