Use CommonMark parsing for Markdown content parity - #155
Merged
Merged
Conversation
Replace Markdown text stripping and repeated-item parsing with the shared CommonMark/GFM AST. Preserve literal code, historical placeholders, and existing HTML extraction and comparison thresholds. Add 20 regressions covering rendered text, code containers, metadata exclusions, multiline catalogs, nested lists, and GFM tables. Document extraction semantics and keep vendor-fence normalization unchanged for discovery consumers. Refs #152.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Embedded SVG markup can cause false parity failures, and the score-changing update lacks the required scoring-version bump.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Migrates Markdown parity analysis to the shared CommonMark/GFM AST for consistent text and structure extraction.
Changes:
- Replaces regex-based Markdown extraction and counting with AST traversal.
- Adds regressions for code, prose, lists, tables, and caching.
- Documents the revised extraction and deduplication semantics.
| File | Description |
|---|---|
src/checks/observability/markdown-content-parity.ts |
Implements AST-based parity extraction and counting. |
src/helpers/parse-markdown.ts |
Adds optional vendor-fence normalization. |
test/unit/checks/markdown-content-parity.test.ts |
Adds CommonMark parity regressions. |
docs/checks/observability.md |
Documents extraction and counting behavior. |
working-notes/parity-check-notes.md |
Records implementation decisions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Extract Markdown text and embedded markup through a shared HTML fragment so paired SVG, MathML, and custom elements are not mistaken for literal placeholders. Escape Markdown text to preserve code and retain standalone unknown placeholders using parsed source ranges. Add 10 regressions covering inline markup, visible text, standalone placeholders, and non-rendered SVG titles. Document the extraction semantics. Addresses review feedback on #155.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Closes #152.
<REGION>.Compatibility
|cannot turn literal code into prose. Discovery and pagination retain their existing default behavior.Verification