xoofx / markdig

A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
BSD 2-Clause "Simplified" License
4.21k stars 444 forks source link

Fix math source span #779

Closed toothache closed 4 months ago

toothache commented 4 months ago

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");