TheOdinProject / theodinproject

Main Website for The Odin Project
http://www.theodinproject.com
MIT License
3.56k stars 2.06k forks source link

Feature: Clickable h4 elements #4507

Closed MaoShizhong closed 2 months ago

MaoShizhong commented 2 months ago

Because

h4 headings were generating IDs but were not clickable like with h3 headings.

This PR

Issue

Closes #4503

Additional Information

Pull Request Requirements

MaoShizhong commented 2 months ago

QA in review app:

  1. Visit a lesson with h4 headings e.g. /lessons/node-path-intermediate-html-and-css-css-units
  2. Click on any h4 to auto-scroll to that subsection.
  3. Open devtools elements pane to view lesson structure:
    • section should have data-title with same name as its first h3 of type's id
    • h3 and h4 should both have ids
    • h4s should have a child a with the correct fragment href
  4. Toc should still work as before - if not, then it's likely the issue that will be fixed in #4506 and conflict can be resolved accordingly.