-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rethink using <h4> in notecards #4394
Comments
We need to make the notecards more consistent. Currently they are be utilized in two ways: Without an h4 and just using <div class="notecard note">
<p><strong>Note:</strong> Class <strong>expressions</strong> are subject to the same hoisting restrictions as described in the <a href="#class_declarations">Class declarations</a> section.</p>
</div> and with an <div class="notecard note">
<h4 id="note">Note</h4>
<p>Until 2019, the <a href="/en-US/docs/Glossary/W3C">W3C</a> published a competing HTML5 standard with version numbers. In MDN docs and elsewhere on the web therefore, you may find references to other HTML versions, HTML5.1 for example. Since <a href="https://www.w3.org/blog/news/archives/7753" class="external" rel=" noopener">28 May 2019</a>, the WHATWG Living Standard was announced by the W3C as the sole version of HTML.</p>
</div> I reckon we just swap the h4 out for a If we need to bump the font-weight/size etc by using |
@tannerdolby I believe we are doing away with heading elements in the new notes. |
First of all, @wbamberg has confirmed that In the en-US content alone, there are roughly 600
With a lot of elbow grease, we could possibly clean that up over a couple of weeks. But who knows what madness will still exist in the translated-content. One thing to watch out for is that it might hard to use <div class="notecard note">
<h4>TEXT HERE</h4>
<p>MORE TEXT HERE</p>
</div> into...: <div class="notecard note">
<p><strong>TEXT HERE</strong> MORE TEXT HERE</p>
</div> because then you're not just messing with the tags, you're messing with the content too. |
So back in the day there weren't very strong guidelines around the markup that should appear in note or warning cards, but generally people used Personally I disagree with this change because it breaks the idea that headings implicitly section a page. But that's by the by. In Markdown we redid the representation of notes and warnings: https://developer.mozilla.org/en-US/docs/MDN/Contribute/Markdown_in_MDN#notes_warnings_and_callouts - they are an GFM blockquote whose first paragraph starts with In the meantime we have to tell the h2m converter how to recognize notes and warnings, given the rather wide range of ways people currently mark them up. Since the most popular option in the JS docs was still So I'm currently manually removing So given this:
...then it's probably pretty safe to auto-convert it to:
...at least given a manual review of the changes. |
I tested quite a few pages in my work for #4060, but I didn't stumble across pages that had a
.note notecard
container with a nested<h4>
. Most of my Lighthouse audit tests were on pages with notes using a<p><strong>Note:</strong> foo bar</p>
structure, any page with notecards that still use an<h4>
will be causing a11y issues by skipping heading levels and creating a non sequentially-descending heading order.Page with
<h4>
in notecard:Page with
<p>
and<strong>
(no h4):The text was updated successfully, but these errors were encountered: