GetFrontMatterLines bug
This commit is contained in:
@ -18,12 +18,18 @@ internal abstract class MarkDown
|
||||
foreach (string jsonLine in jsonLines)
|
||||
{
|
||||
afterTrim = jsonLine.Trim();
|
||||
if (afterTrim.Length < 3)
|
||||
if (string.IsNullOrEmpty(afterTrim) || afterTrim.First() is '{' or '}')
|
||||
continue;
|
||||
segments = afterTrim.Split(": ");
|
||||
if (segments.Length != 2)
|
||||
{
|
||||
results.Clear();
|
||||
break;
|
||||
}
|
||||
if (afterTrim[^1] != ',')
|
||||
results.Add(afterTrim[1..].Replace("\": \"", ": \""));
|
||||
results.Add(afterTrim[1..].Replace("\": ", ": "));
|
||||
else
|
||||
results.Add(afterTrim[1..^1].Replace("\": \"", ": \""));
|
||||
results.Add(afterTrim[1..^1].Replace("\": ", ": "));
|
||||
}
|
||||
if (results.Any())
|
||||
{
|
||||
|
Reference in New Issue
Block a user