Skip to content

Commit

Permalink
Merge pull request #370 from Lombiq/issue/OSOE-770-fix
Browse files Browse the repository at this point in the history
OSOE-770: Fix uncovered edge cases
  • Loading branch information
DemeSzabolcs authored May 14, 2024
2 parents 45cb69c + 603919b commit dadc625
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lombiq.Tests.UI/Extensions/HtmlValidationResultExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ private static IEnumerable<JsonHtmlValidationError> ParseOutput(string output)
{
// In some cases the output is too large and is not a valid JSON anymore. In this case we need to fix it.
// tracking issue: https://github.com/atata-framework/atata-htmlvalidation/issues/9
if (output.Trim().StartsWith('[') && !output.Trim().EndsWith(']'))
int index = output.IndexOf(",\"source\":", StringComparison.Ordinal);
if (index != -1)
{
output += "\"}]";
output = output[..index];
output += "}]";
}

var document = JsonDocument.Parse(output);
Expand Down

0 comments on commit dadc625

Please sign in to comment.