Fix compatibility report parser for 4-backtick fences #52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the compatibility report's test file parser to correctly parse official djot test files that use 4-backtick fences.
The Problem
The compatibility report was showing 2 failing tests (99% compatibility), but investigation revealed the actual djot parser handles these cases correctly. The issue was in how
tests/compatibility-report.phpparses the official test files.Many djot tests use 4-backtick fences (``````) to wrap test cases that contain 3-backtick code blocks (
```). The parser's regex only matched 3-backtick fences, causing it to incorrectly parse nested content.The Fix
Updated the regex to match both fence lengths:
Result
The increase in test count (238 → 245) is because tests wrapped in 4-backtick fences are now correctly parsed, and some test files had additional tests that were previously missed.