Basic HTML heading test (#5619)

This commit is contained in:
Johann Birnick 2025-01-06 05:13:53 -08:00 committed by GitHub
parent 36508c66db
commit 3a1503154f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h2>
Level 1
</h2>
<h3>
Level 2
</h3>
<h4>
Level 3
</h4>
<h5>
Level 4
</h5>
<h6>
Level 5
</h6>
<div role="heading" aria-level="7">
Level 6
</div>
<div role="heading" aria-level="8">
Level 7
</div>
</body>
</html>

View File

@ -115,3 +115,24 @@ Not in heading
// Error: 1:19-1:25 cannot reference heading without numbering
// Hint: 1:19-1:25 you can enable heading numbering with `#set heading(numbering: "1.")`
Cannot be used as @intro
--- heading-html-basic html ---
// level 1 => h2
// ...
// level 5 => h6
// level 6 => div with role=heading and aria-level=7
// ...
= Level 1
== Level 2
=== Level 3
==== Level 4
===== Level 5
// Warning: 1-15 heading of level 6 was transformed to <div role="heading" aria-level="7">, which is not supported by all assistive technology
// Hint: 1-15 HTML only supports <h1> to <h6>, not <h7>
// Hint: 1-15 you may want to restructure your document so that it doesn't contain deep headings
====== Level 6
// Warning: 1-16 heading of level 7 was transformed to <div role="heading" aria-level="8">, which is not supported by all assistive technology
// Hint: 1-16 HTML only supports <h1> to <h6>, not <h8>
// Hint: 1-16 you may want to restructure your document so that it doesn't contain deep headings
======= Level 7