fix(course): Demote Markdown headings one level in lesson rendering#99
Merged
Conversation
The lesson page provides the single h1 (the lesson title), so an instructor's "# Heading" produced a second h1 and broke the one-h1, no-skipped-level heading hierarchy that docs/rgaa.md commits to for RGAA 9.1. A custom commonmark-java NodeRenderer now shifts every Markdown heading one HTML level down (h1 becomes h2, capped at h6) while keeping inline formatting inside the heading. The jsoup sanitization and the content-addressed cache of ADR-0013 are unchanged, so existing lessons pick the corrected levels up on their next render with no migration. The decision and its alternatives are recorded in ADR-0014.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #99 +/- ##
============================================
+ Coverage 76.90% 77.53% +0.62%
Complexity 141 141
============================================
Files 31 31
Lines 576 592 +16
Branches 36 37 +1
============================================
+ Hits 443 459 +16
Misses 106 106
Partials 27 27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This PR fixes the lesson Markdown-to-HTML rendering to ensure there is a single
<h1>to comply with RGAA 9.1.The
lessonpage template provides the singleh1tag (the lesson title).Without this fix, when an instructor adds a lesson with a level-one Markdown heading "# Heading", this would produce a second
h1, and break the one-h1, no-skipped-level heading hierarchy thatdocs/rgaa.mdcommits to for RGAA 9.1.A custom commonmark-java
NodeRenderernow shifts every Markdown heading one HTML level down (h1becomesh2, capped ath6) while keeping inline formatting inside the heading.The jsoup sanitization and the content-addressed cache of ADR-0013 are unchanged, so existing lessons pick the corrected levels up on their next render with no migration.
The decision and its alternatives are recorded in ADR-0014.