mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
LinkInlines created via AutoLinkParser are incorrectly rendered with RoundtripRenderer #766
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?
Originally created by @geffner on GitHub (Dec 19, 2025).
Sample code:
Expected output is one of the following:
[http://example.com/](http://example.com/)<http://example.com/>Actual output:
[http://example.com/]()The actual output consists of a broken hyperlink for the following reason.
When markdig parses Markdown and identifies a URL as an autolink, it creates a
LinkInlinefor it and sets the.Urlfield to be the URL for the link./src/Markdig/Extensions/AutoLinks/AutoLinkParser.cs:
However, when this
LinkInlineobject is rendered back to Markdown, only the object's.UnescapedUrlfield is used, not the.Urlfield. And since that.UnescapedUrlfield is never assigned a value, it ends up getting rendered as an empty string./src/Markdig/Renderers/Roundtrip/Inlines/LinkInlineRenderer.cs: