mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-08 21:37:02 +00:00
Fix issue while detecting generic attributes that was breaking parsing (issue #16)
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Markdig.Extensions.GenericAttributes
|
||||
// Try to find if there is any attributes { in the info string on the first line of a FencedCodeBlock
|
||||
if (line.Start < line.End)
|
||||
{
|
||||
var indexOfAttributes = line.Text.LastIndexOf('{', line.End);
|
||||
int indexOfAttributes = line.IndexOf('{');
|
||||
if (indexOfAttributes >= 0)
|
||||
{
|
||||
// Work on a copy
|
||||
|
||||
@@ -221,6 +221,22 @@ namespace Markdig.Helpers
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Searches for the specified character within this slice.
|
||||
/// </summary>
|
||||
/// <returns>A value >= 0 if the character was found, otherwise < 0</returns>
|
||||
public int IndexOf(char c)
|
||||
{
|
||||
for (int i = Start; i <= End; i++)
|
||||
{
|
||||
if (Text[i] == c)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Searches the specified text within this slice (matching lowercase).
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user