You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be a bug in the position (not all elements, specially the one not CommonMark like table are necessarily tested for their text position)
That being said, this ExtractText function feels complicated to extract the line/column/span information. Not sure why you are not using the properties behind (Span, Line, Column) here
public static string ExtractText(string text, Block item)
{
var pos = item.ToPositionText(); // $295, 0, 13301-13375
// parse "$295, 0, 13301-13375" into lines, columns, range variables
var line = pos.Split(",")[0].TrimStart('$').Trim();
var column = pos.Split(",")[1].Trim();
var range = pos.Split(",")[2].Trim();
var start = range.Split("-")[0];
var end = range.Split("-")[1];
var blockText = text.Substring(int.Parse(start), int.Parse(end) - int.Parse(start) + 1);
return blockText;
}
Here is my code that can run under LINQPad:
When running this code, the parsed output will remove the opening and ending characters. It seems a bug.
The text was updated successfully, but these errors were encountered: