Issue with JSON validation in Markdown code blocks


I’m not sure if this is the best place to report it.

But I think that I found an issue with JSON validation in Markdown files. The specific JSON code block seems to cause an issue with the validator, and in consequence, the rest of the Markdown file is marked an invalid, which seems like an unexpected behavior.

The issue is visible in blame view and when referring to the source code in issues and pull requests.

The very example of this behavior that I found:

Direct link to the blame of the problematic file:

Best regards,

The JSON isn’t terminated properly, and ... isn’t valid JSON syntax. I wonder if syntax highlighting would work correctly if you close the open JSON blocks after the ellipsis? But I agree that highlighting the rest of the file beyond the code block like invalid JSON is a bug. :sweat_smile:

You can try reporting the problem to the GitHub feedback form: Share feedback - GitHub Support

1 Like

I tested on a toy example, and it seems that you’re right. Closing opened blocks makes this bug disappear:

Thanks for the link, I’ll report it :smiley:

1 Like

I noticed that just skipping the closing tags makes this issue to appear: