mirror of
https://github.com/xoofx/markdig.git
synced 2026-10-08 22:57:51 +00:00
Improve InlineProcessor.GetSourcePosition
This commit is contained in:
@@ -134,10 +134,13 @@ namespace Markdig.Parsers
|
||||
var lineOffset = lineOffsets[lineIndex];
|
||||
if (sliceOffset <= lineOffset.End)
|
||||
{
|
||||
column = sliceOffset - lineOffsets[lineIndex].Start;
|
||||
// Use the beginning of the line as a previous slice offset
|
||||
// (since it is on the same line)
|
||||
previousSliceOffset = lineOffsets[lineIndex].Start;
|
||||
column = sliceOffset - previousSliceOffset;
|
||||
position = lineOffset.LinePosition + column;
|
||||
previousSliceOffset = sliceOffset;
|
||||
previousLineIndexForSliceOffset = lineIndex;
|
||||
|
||||
// Return an absolute line index
|
||||
lineIndex = lineIndex + LineIndex;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user