fix: slice from initial index
This commit is contained in:
parent
030e5fdd3d
commit
6743918f44
@ -1,4 +1,4 @@
|
|||||||
using Cysharp.Text;
|
using Cysharp.Text;
|
||||||
using Markdig.Helpers;
|
using Markdig.Helpers;
|
||||||
using Markdig.Parsers;
|
using Markdig.Parsers;
|
||||||
|
|
||||||
@ -104,6 +104,8 @@ public sealed class TemplateInlineParser : InlineParser
|
|||||||
out bool hasValue)
|
out bool hasValue)
|
||||||
{
|
{
|
||||||
var isEscaped = false;
|
var isEscaped = false;
|
||||||
|
|
||||||
|
int startIndex = index;
|
||||||
for (; index < argumentSpan.Length; index++)
|
for (; index < argumentSpan.Length; index++)
|
||||||
{
|
{
|
||||||
char currentChar = argumentSpan[index];
|
char currentChar = argumentSpan[index];
|
||||||
@ -119,16 +121,16 @@ public sealed class TemplateInlineParser : InlineParser
|
|||||||
|
|
||||||
case '|' when !isEscaped:
|
case '|' when !isEscaped:
|
||||||
hasValue = false;
|
hasValue = false;
|
||||||
return argumentSpan[..index];
|
return argumentSpan[startIndex..index];
|
||||||
|
|
||||||
case '=' when !isEscaped && !consumeToken:
|
case '=' when !isEscaped && !consumeToken:
|
||||||
hasValue = true;
|
hasValue = true;
|
||||||
return argumentSpan[..index];
|
return argumentSpan[startIndex..index];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hasValue = false;
|
hasValue = false;
|
||||||
return argumentSpan[..index];
|
return argumentSpan[startIndex..index];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ReadOnlySpan<char> ReadUntilClosure(ReadOnlySpan<char> input)
|
private static ReadOnlySpan<char> ReadUntilClosure(ReadOnlySpan<char> input)
|
||||||
|
Loading…
Reference in New Issue
Block a user