Get LinkInline.Title of "" rather than null for [link](/uri) #742

Closed
opened 2026-01-29 14:44:28 +00:00 by claunia · 1 comment
Owner

Originally created by @RamType0 on GitHub (May 10, 2025).

We get LinkInline.Title of "" with CommonMark Example 443.

[link](/uri)

As LinkInline.Title is typed as string? rather than string, it is weird.

3535701d70/src/Markdig/Renderers/Html/Inlines/LinkInlineRenderer.cs (L72-L77)

HtmlRenderer render correct result for [link](/uri) with current parse behavior, but it will generate incorrect result for [link](/uri "") instead.

Originally created by @RamType0 on GitHub (May 10, 2025). We get `LinkInline.Title` of `""` with [CommonMark Example 443](https://spec.commonmark.org/0.22/#example-443). > `[link](/uri)` As `LinkInline.Title` is typed as `string?` rather than `string`, it is weird. https://github.com/xoofx/markdig/blob/3535701d70066d055d06adaeaa1531b10601c6ac/src/Markdig/Renderers/Html/Inlines/LinkInlineRenderer.cs#L72-L77 `HtmlRenderer` render correct result for `[link](/uri)` with current parse behavior, but it will generate incorrect result for `[link](/uri "")` instead.
claunia added the bugPR Welcome! labels 2026-01-29 14:44:28 +00:00
Author
Owner

@Akarinnnnn commented on GitHub (May 31, 2025):

This line normalized nulls into empty string. Not sure will comment this out cause problems.
3535701d70/src/Markdig/Helpers/LinkHelper.cs (L414)

@Akarinnnnn commented on GitHub (May 31, 2025): This line normalized nulls into empty string. Not sure will comment this out cause problems. https://github.com/xoofx/markdig/blob/3535701d70066d055d06adaeaa1531b10601c6ac/src/Markdig/Helpers/LinkHelper.cs#L414
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#742