LineBreakInline at the end of a paragraph has wrong Span Start and End #619

Closed
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 (and Start) of a LineBreakInline when the LineBreakInline is the last inline in a paragraph.
Example Input: "a\n"
Expected behavior: The Span.Start and Span.End of the LineBreakInline should be 1.
Actual behavior: The Span.Start of the LineBreakInline is 0 and the Span.End is -1.

If the LineBreakInline is not the last inline in the paragraph then Span.Start and Span.End are set correctly.

Workaround: Calculate the Span.Start and Span.End based on PreviousSibling.Span for LineBreakInlines where Span.End is -1 manually.

Originally created by @zickb on GitHub (Aug 17, 2023). There is an issue with the `Inline.Span.End` (and Start) of a LineBreakInline when the LineBreakInline is the last inline in a paragraph. Example Input: "a\n" Expected behavior: The Span.Start and Span.End of the LineBreakInline should be 1. Actual behavior: The Span.Start of the LineBreakInline is 0 and the Span.End is -1. If the LineBreakInline is not the last inline in the paragraph then Span.Start and Span.End are set correctly. Workaround: Calculate the Span.Start and Span.End based on PreviousSibling.Span for LineBreakInlines where Span.End is -1 manually.
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#619