[PR #834] Fix an incorrect offset in GridTableParser. #1248

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

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

State: closed
Merged: Yes


Instead of the intended index to the table line content, an offset to the global source is used. The resulting offset is beyond the end of the table line, and if there happens to be a bar '|' there, the last character of the line is cut off.

For example:

// 01234567 8 9012345 6 7890123
  "+--+--+\r\n|11|12\r\n>     |"

The start of the second line of the table (9) + the line end (14) is 23, and there is a bar at 23. So this string results in a table containing "11", "1" (not "12").

**Original Pull Request:** https://github.com/xoofx/markdig/pull/834 **State:** closed **Merged:** Yes --- Instead of the intended index to the table line content, an offset to the global source is used. The resulting offset is beyond the end of the table line, and if there happens to be a bar '|' there, the last character of the line is cut off. For example: ``` // 01234567 8 9012345 6 7890123 "+--+--+\r\n|11|12\r\n> |" ``` The start of the second line of the table (9) + the line end (14) is 23, and there is a bar at 23. So this string results in a table containing "11", "1" (not "12").
claunia added the pull-request label 2026-01-29 14:52:02 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#1248