summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/ref/html/heading-html-basic.html30
-rw-r--r--tests/suite/model/heading.typ21
2 files changed, 51 insertions, 0 deletions
diff --git a/tests/ref/html/heading-html-basic.html b/tests/ref/html/heading-html-basic.html
new file mode 100644
index 00000000..69a1d017
--- /dev/null
+++ b/tests/ref/html/heading-html-basic.html
@@ -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> \ No newline at end of file
diff --git a/tests/suite/model/heading.typ b/tests/suite/model/heading.typ
index d182724c..72dc4aa3 100644
--- a/tests/suite/model/heading.typ
+++ b/tests/suite/model/heading.typ
@@ -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