[PR #253] [CLOSED] Autolink domain name validation #895

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

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/253
Author: @MihaZupan
Created: 10/6/2018
Status: Closed

Base: masterHead: master


📝 Commits (3)

  • 25db277 Add autolink domain validation
  • dfc6702 Add autolink domain validation tests
  • 721288e Update Specs.cs

📊 Changes

4 files changed (+7399 additions, -3114 deletions)

View changed files

📝 src/Markdig.Tests/Specs/AutoLinks.md (+81 -1)
📝 src/Markdig.Tests/Specs/Specs.cs (+7250 -3098)
📝 src/Markdig/Extensions/AutoLinks/AutoLinkParser.cs (+20 -12)
📝 src/Markdig/Helpers/LinkHelper.cs (+48 -3)

📄 Description

#252

This makes it so AutoLinkParser doesn't match links with domain names, that:

  • Have empty segments
  • Have less than 2 segments
  • Contain invalid characters
  • Contain an underscore in the last two segments

This also doesn't match empty emails in mailto: (mailto:@something.com)

@xoofx
I included the Specs.cs file that my VS emits, but it's obviously seriously deformed. Any idea on how to fix it? (I will obviously amend the last commit if I figure that one out)


🔄 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/253 **Author:** [@MihaZupan](https://github.com/MihaZupan) **Created:** 10/6/2018 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`25db277`](https://github.com/xoofx/markdig/commit/25db2774c3474901fe217b72582c3094c6d5715c) Add autolink domain validation - [`dfc6702`](https://github.com/xoofx/markdig/commit/dfc67021ee42c5eac65afe8331876eb9bbb16230) Add autolink domain validation tests - [`721288e`](https://github.com/xoofx/markdig/commit/721288e956284388d1f4f2b9a4963424feafd266) Update Specs.cs ### 📊 Changes **4 files changed** (+7399 additions, -3114 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig.Tests/Specs/AutoLinks.md` (+81 -1) 📝 `src/Markdig.Tests/Specs/Specs.cs` (+7250 -3098) 📝 `src/Markdig/Extensions/AutoLinks/AutoLinkParser.cs` (+20 -12) 📝 `src/Markdig/Helpers/LinkHelper.cs` (+48 -3) </details> ### 📄 Description #252 This makes it so AutoLinkParser doesn't match links with domain names, that: * Have empty segments * Have less than 2 segments * Contain invalid characters * Contain an underscore in the last two segments This also doesn't match empty emails in mailto: (mailto:@something.com) @xoofx I included the Specs.cs file that my VS emits, but it's obviously seriously deformed. Any idea on how to fix it? (I will obviously amend the last commit if I figure that one out) --- <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:46:57 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#895