[PR #779] Fix math source span #1225

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

Original Pull Request: https://github.com/xoofx/markdig/pull/779

State: closed
Merged: Yes


Fix math source span calculation.

The span is wrong if a math is followed with more texts:

Check("0\n012 \abcd\\ 321", @"
paragraph ( 0, 0) 0-15
literal ( 0, 0) 0-0
linebreak ( 0, 1) 1-1
literal ( 1, 0) 2-5
math ( 1, 4) 6-15 (incorrect)
attributes ( 0, 0) 0--1
literal ( 1,10) 12-15
", "mathematics");

**Original Pull Request:** https://github.com/xoofx/markdig/pull/779 **State:** closed **Merged:** Yes --- Fix math source span calculation. The span is wrong if a math is followed with more texts: > Check("0\n012 \\$abcd\\$ 321", @" paragraph ( 0, 0) 0-15 literal ( 0, 0) 0-0 linebreak ( 0, 1) 1-1 literal ( 1, 0) 2-5 **math ( 1, 4) 6-15** (incorrect) attributes ( 0, 0) 0--1 literal ( 1,10) 12-15 ", "mathematics");
claunia added the pull-request label 2026-01-29 14:51:41 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#1225