FSharp.Formatting
FSharp.Formatting copied to clipboard
Markdown: some spans have incorrect ranges
It looks like some spans have incorrect ranges. The repro is here.
Note that the actual range for " After" span is (1,7)-(1,13), while I'd expect it to be (1,21)-(1,27).
// 1 2
// 0123456789012345678901234567
let doc = "Before [indirectLink] After" |> Markdown.Parse
-----
Expected: [Paragraph
([Literal ("Before", Some { StartLine = 1
StartColumn = 0
EndLine = 1
EndColumn = 7 });
IndirectLink
([Literal ("indirectLink", Some { StartLine = 1
StartColumn = 8
EndLine = 1
EndColumn = 20 })], "", "indirectLink",
Some { StartLine = 1
StartColumn = 7
EndLine = 1
EndColumn = 21 }); Literal (" After", Some { StartLine = 1
StartColumn = 21
EndLine = 1
EndColumn = 27 })],
Some { StartLine = 1
StartColumn = 0
EndLine = 1
EndColumn = 27 })]
Actual: [Paragraph
([Literal ("Before ", Some { StartLine = 1
StartColumn = 0
EndLine = 1
EndColumn = 7 });
IndirectLink
([Literal ("indirectLink", Some { StartLine = 1
StartColumn = 7
EndLine = 1
EndColumn = 19 })], "", "indirectLink",
Some { StartLine = 1
StartColumn = 7
EndLine = 1
EndColumn = 27 }); Literal (" After", Some { StartLine = 1
StartColumn = 7
EndLine = 1
EndColumn = 13 })],
Some { StartLine = 1
StartColumn = 0
EndLine = 1
EndColumn = 27 })]