ContainerInline with a ParentBlock has a wrong Span End #618

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

Originally created by @zickb on GitHub (Aug 17, 2023).

There is an issue with the Inline.Span.End in case of a container inline with a parent block.
Example Input: "a\n"
Expected behavior: The Span.End of the container inline should be 1.
Actual behavior: The Span.End of the container inline is 0.

Workaround (does not work trivially if https://github.com/xoofx/markdig/issues/730 is hit):

if (inline is ContainerInline { ParentBlock: not null } containerInline)
    return new SourceSpan(containerInline.FirstChild?.Span.Start ?? 0, containerInline.LastChild?.Span.End ?? 0);

Related issue: https://github.com/xoofx/markdig/issues/702

Originally created by @zickb on GitHub (Aug 17, 2023). There is an issue with the `Inline.Span.End` in case of a container inline with a parent block. Example Input: "a\n" Expected behavior: The Span.End of the container inline should be 1. Actual behavior: The Span.End of the container inline is 0. Workaround (does not work trivially if https://github.com/xoofx/markdig/issues/730 is hit): ``` if (inline is ContainerInline { ParentBlock: not null } containerInline) return new SourceSpan(containerInline.FirstChild?.Span.Start ?? 0, containerInline.LastChild?.Span.End ?? 0); ``` Related issue: https://github.com/xoofx/markdig/issues/702
claunia added the bugPR Welcome! labels 2026-01-29 14:41:20 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#618