@readium/guided-navigation 1.2.3 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/README.md +4 -1
  2. package/dist/converter.js +1 -1
  3. package/dist/elementHandlers.js +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/object.js +1 -1
  6. package/dist/roles.js +1 -1
  7. package/fixtures/ROLES_COVERAGE.md +13 -11
  8. package/fixtures/abbreviation-nested-term-punctuation/gnd.json +6 -6
  9. package/fixtures/abbreviation-nested-term-punctuation/input.html +1 -1
  10. package/fixtures/abbreviation-nested-term-punctuation/meta.json +1 -1
  11. package/fixtures/abbreviation-period-mid-sentence/gnd.json +9 -0
  12. package/fixtures/abbreviation-period-mid-sentence/input.html +1 -0
  13. package/fixtures/abbreviation-period-mid-sentence/meta.json +11 -0
  14. package/fixtures/abbreviation-period-sentence-end/gnd.json +9 -0
  15. package/fixtures/abbreviation-period-sentence-end/input.html +1 -0
  16. package/fixtures/abbreviation-period-sentence-end/meta.json +11 -0
  17. package/fixtures/accessible-name-labelledby-aria-hidden/gnd.json +1 -1
  18. package/fixtures/accessible-name-labelledby-hidden-attribute/gnd.json +1 -1
  19. package/fixtures/biblioref-target-descendant-ids/gnd.json +3 -3
  20. package/fixtures/biblioref-target-in-bibliography-role-aria/gnd.json +1 -1
  21. package/fixtures/biblioref-target-mixed-content/gnd.json +3 -3
  22. package/fixtures/description-roleless-lone-child/gnd.json +24 -0
  23. package/fixtures/description-roleless-lone-child/input.html +1 -0
  24. package/fixtures/description-roleless-lone-child/meta.json +11 -0
  25. package/fixtures/description-roleless-wrapper/gnd.json +25 -0
  26. package/fixtures/description-roleless-wrapper/input.html +1 -0
  27. package/fixtures/description-roleless-wrapper/meta.json +10 -0
  28. package/fixtures/glossary-role-aria/gnd.json +23 -31
  29. package/fixtures/glossref-role-aria-mid-sentence/gnd.json +1 -1
  30. package/fixtures/glossref-sole-content/gnd.json +12 -20
  31. package/fixtures/glossref-target-in-glossary-role-aria/gnd.json +13 -21
  32. package/fixtures/glossref-target-percent-encoded/gnd.json +1 -1
  33. package/fixtures/language-alt-inherited/gnd.json +25 -0
  34. package/fixtures/language-alt-inherited/input.html +1 -0
  35. package/fixtures/language-alt-inherited/meta.json +11 -0
  36. package/fixtures/language-alt-own-lang/gnd.json +25 -0
  37. package/fixtures/language-alt-own-lang/input.html +1 -0
  38. package/fixtures/language-alt-own-lang/meta.json +11 -0
  39. package/fixtures/language-block-empty-lang/gnd.json +8 -0
  40. package/fixtures/language-block-empty-lang/input.html +1 -0
  41. package/fixtures/language-block-empty-lang/meta.json +10 -0
  42. package/fixtures/language-describedby-shared/gnd.json +49 -0
  43. package/fixtures/language-describedby-shared/input.html +1 -0
  44. package/fixtures/language-describedby-shared/meta.json +12 -0
  45. package/fixtures/language-empty-lang-stops-inheritance/gnd.json +24 -0
  46. package/fixtures/language-empty-lang-stops-inheritance/input.html +1 -0
  47. package/fixtures/language-empty-lang-stops-inheritance/meta.json +11 -0
  48. package/fixtures/language-figcaption/gnd.json +25 -0
  49. package/fixtures/language-figcaption/input.html +1 -0
  50. package/fixtures/language-figcaption/meta.json +11 -0
  51. package/fixtures/language-figcaption-credit/gnd.json +41 -0
  52. package/fixtures/language-figcaption-credit/input.html +1 -0
  53. package/fixtures/language-figcaption-credit/meta.json +12 -0
  54. package/fixtures/language-figcaption-switches/gnd.json +24 -0
  55. package/fixtures/language-figcaption-switches/input.html +1 -0
  56. package/fixtures/language-figcaption-switches/meta.json +11 -0
  57. package/fixtures/language-figcaption-switches-throughout/gnd.json +25 -0
  58. package/fixtures/language-figcaption-switches-throughout/input.html +1 -0
  59. package/fixtures/language-figcaption-switches-throughout/meta.json +11 -0
  60. package/fixtures/language-inline-case-insensitive/gnd.json +9 -0
  61. package/fixtures/language-inline-case-insensitive/input.html +1 -0
  62. package/fixtures/language-inline-case-insensitive/meta.json +10 -0
  63. package/fixtures/language-inline-case-insensitive-ssml/gnd.json +9 -0
  64. package/fixtures/language-inline-case-insensitive-ssml/input.html +1 -0
  65. package/fixtures/language-inline-case-insensitive-ssml/meta.json +10 -0
  66. package/fixtures/language-inline-empty-lang/gnd.json +9 -0
  67. package/fixtures/language-inline-empty-lang/input.html +1 -0
  68. package/fixtures/language-inline-empty-lang/meta.json +10 -0
  69. package/fixtures/language-inline-empty-lang-formatted/gnd.json +8 -0
  70. package/fixtures/language-inline-empty-lang-formatted/input.html +1 -0
  71. package/fixtures/language-inline-empty-lang-formatted/meta.json +10 -0
  72. package/fixtures/language-inline-empty-lang-only/gnd.json +8 -0
  73. package/fixtures/language-inline-empty-lang-only/input.html +1 -0
  74. package/fixtures/language-inline-empty-lang-only/meta.json +10 -0
  75. package/fixtures/language-inline-empty-lang-undeclared/gnd.json +9 -0
  76. package/fixtures/language-inline-empty-lang-undeclared/input.html +1 -0
  77. package/fixtures/language-inline-empty-lang-undeclared/meta.json +10 -0
  78. package/fixtures/language-labelledby-target/gnd.json +26 -0
  79. package/fixtures/language-labelledby-target/input.html +1 -0
  80. package/fixtures/language-labelledby-target/meta.json +11 -0
  81. package/fixtures/language-labelledby-target-aria-label/gnd.json +32 -0
  82. package/fixtures/language-labelledby-target-aria-label/input.html +1 -0
  83. package/fixtures/language-labelledby-target-aria-label/meta.json +11 -0
  84. package/fixtures/language-labelledby-target-switches/gnd.json +25 -0
  85. package/fixtures/language-labelledby-target-switches/input.html +1 -0
  86. package/fixtures/language-labelledby-target-switches/meta.json +11 -0
  87. package/fixtures/language-labelledby-targets-case/gnd.json +36 -0
  88. package/fixtures/language-labelledby-targets-case/input.html +1 -0
  89. package/fixtures/language-labelledby-targets-case/meta.json +11 -0
  90. package/fixtures/language-labelledby-targets-differ/gnd.json +35 -0
  91. package/fixtures/language-labelledby-targets-differ/input.html +1 -0
  92. package/fixtures/language-labelledby-targets-differ/meta.json +11 -0
  93. package/fixtures/language-link-switches/gnd.json +20 -0
  94. package/fixtures/language-link-switches/input.html +1 -0
  95. package/fixtures/language-link-switches/meta.json +11 -0
  96. package/fixtures/language-pagebreak-label/gnd.json +22 -0
  97. package/fixtures/language-pagebreak-label/input.html +1 -0
  98. package/fixtures/language-pagebreak-label/meta.json +11 -0
  99. package/fixtures/language-undeclared-description/gnd.json +23 -0
  100. package/fixtures/language-undeclared-description/input.html +1 -0
  101. package/fixtures/language-undeclared-description/meta.json +11 -0
  102. package/fixtures/language-xml-lang-empty-html-inherits/gnd.json +25 -0
  103. package/fixtures/language-xml-lang-empty-html-inherits/input.html +1 -0
  104. package/fixtures/language-xml-lang-empty-html-inherits/meta.json +11 -0
  105. package/fixtures/language-xml-lang-empty-html-lang-applies/gnd.json +25 -0
  106. package/fixtures/language-xml-lang-empty-html-lang-applies/input.html +1 -0
  107. package/fixtures/language-xml-lang-empty-html-lang-applies/meta.json +11 -0
  108. package/fixtures/language-xml-lang-empty-xhtml/gnd.json +24 -0
  109. package/fixtures/language-xml-lang-empty-xhtml/input.xhtml +2 -0
  110. package/fixtures/language-xml-lang-empty-xhtml/meta.json +11 -0
  111. package/fixtures/language-xml-lang-over-lang/gnd.json +25 -0
  112. package/fixtures/language-xml-lang-over-lang/input.html +1 -0
  113. package/fixtures/language-xml-lang-over-lang/meta.json +11 -0
  114. package/fixtures/link-containing-image/gnd.json +35 -0
  115. package/fixtures/link-containing-image/input.html +1 -0
  116. package/fixtures/link-containing-image/meta.json +12 -0
  117. package/fixtures/link-containing-pagebreak/gnd.json +33 -0
  118. package/fixtures/link-containing-pagebreak/input.html +1 -0
  119. package/fixtures/link-containing-pagebreak/meta.json +12 -0
  120. package/fixtures/link-content-conversion/gnd.json +31 -0
  121. package/fixtures/link-content-conversion/input.html +1 -0
  122. package/fixtures/link-content-conversion/meta.json +12 -0
  123. package/fixtures/link-content-identity/gnd.json +21 -0
  124. package/fixtures/link-content-identity/input.html +1 -0
  125. package/fixtures/link-content-identity/meta.json +10 -0
  126. package/fixtures/link-content-words/gnd.json +46 -0
  127. package/fixtures/link-content-words/input.html +1 -0
  128. package/fixtures/link-content-words/meta.json +10 -0
  129. package/fixtures/manifest.json +431 -1
  130. package/fixtures/math-inline/gnd.json +22 -0
  131. package/fixtures/math-inline/input.html +1 -0
  132. package/fixtures/math-inline/meta.json +11 -0
  133. package/fixtures/nested-blockquote/gnd.json +22 -0
  134. package/fixtures/nested-blockquote/input.html +5 -0
  135. package/fixtures/nested-blockquote/meta.json +11 -0
  136. package/fixtures/nested-section/gnd.json +22 -0
  137. package/fixtures/nested-section/input.html +5 -0
  138. package/fixtures/nested-section/meta.json +11 -0
  139. package/fixtures/redundant-role-body-chapter/gnd.json +23 -0
  140. package/fixtures/redundant-role-body-chapter/input.xhtml +10 -0
  141. package/fixtures/redundant-role-body-chapter/meta.json +13 -0
  142. package/fixtures/redundant-role-nested-chapter/gnd.json +30 -0
  143. package/fixtures/redundant-role-nested-chapter/input.xhtml +12 -0
  144. package/fixtures/redundant-role-nested-chapter/meta.json +13 -0
  145. package/fixtures/table-cell-link/gnd.json +48 -0
  146. package/fixtures/table-cell-link/input.html +1 -0
  147. package/fixtures/table-cell-link/meta.json +14 -0
  148. package/fixtures/term-span-in-dt/gnd.json +24 -0
  149. package/fixtures/term-span-in-dt/input.html +4 -0
  150. package/fixtures/term-span-in-dt/meta.json +12 -0
  151. package/package.json +1 -1
  152. package/src/converter.ts +72 -15
  153. package/src/elementHandlers.ts +31 -11
  154. package/src/emptyPairs.ts +2 -1
  155. package/src/index.ts +1 -0
  156. package/src/object.ts +7 -10
  157. package/src/roles.ts +49 -0
  158. package/types/src/converter.d.ts +21 -2
  159. package/types/src/emptyPairs.d.ts +2 -0
  160. package/types/src/index.d.ts +1 -0
  161. package/types/src/object.d.ts +1 -0
  162. package/types/src/roles.d.ts +1 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "role": [
3
+ "paragraph"
4
+ ],
5
+ "text": {
6
+ "ssml": "Hello <lang xml:lang=\"\">xyz</lang> end.",
7
+ "language": "en"
8
+ }
9
+ }
@@ -0,0 +1 @@
1
+ <p>Hello <span lang="">xyz</span> end.</p>
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "language-inline-empty-lang-undeclared",
3
+ "description": "An empty lang declaration is a language shift in SSML even when no language is declared around it",
4
+ "role": "language",
5
+ "rolesCovered": [
6
+ "paragraph"
7
+ ],
8
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
9
+ "inputKind": "fragment"
10
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "id": "l",
5
+ "role": [
6
+ "paragraph"
7
+ ],
8
+ "text": {
9
+ "plain": "Eine Katze",
10
+ "language": "de"
11
+ }
12
+ },
13
+ {
14
+ "imgref": "a.png",
15
+ "role": [
16
+ "image"
17
+ ],
18
+ "description": {
19
+ "text": {
20
+ "plain": "Eine Katze",
21
+ "language": "de"
22
+ }
23
+ }
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><p id="l" lang="de">Eine Katze</p><img src="a.png" aria-labelledby="l"></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-labelledby-target",
3
+ "description": "An aria-labelledby description is in its target's language",
4
+ "role": "image",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "id": "l",
5
+ "role": [
6
+ "paragraph"
7
+ ],
8
+ "text": {
9
+ "plain": "x",
10
+ "language": "de"
11
+ },
12
+ "description": {
13
+ "text": {
14
+ "plain": "Eine Katze",
15
+ "language": "de"
16
+ }
17
+ }
18
+ },
19
+ {
20
+ "imgref": "a.png",
21
+ "role": [
22
+ "image"
23
+ ],
24
+ "description": {
25
+ "text": {
26
+ "plain": "Eine Katze",
27
+ "language": "de"
28
+ }
29
+ }
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><p id="l" lang="de" aria-label="Eine Katze">x</p><img src="a.png" aria-labelledby="l"></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-labelledby-target-aria-label",
3
+ "description": "An aria-labelledby target's own aria-label is in that target's language",
4
+ "role": "image",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "id": "l",
5
+ "role": [
6
+ "paragraph"
7
+ ],
8
+ "text": {
9
+ "ssml": "Un <lang xml:lang=\"en\">cat</lang>",
10
+ "language": "fr"
11
+ }
12
+ },
13
+ {
14
+ "imgref": "a.png",
15
+ "role": [
16
+ "image"
17
+ ],
18
+ "description": {
19
+ "text": {
20
+ "plain": "Un cat"
21
+ }
22
+ }
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><p id="l">Un <span lang="en">cat</span></p><img src="a.png" aria-labelledby="l"></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-labelledby-target-switches",
3
+ "description": "An aria-labelledby description has no language when its text switches language inside a target",
4
+ "role": "image",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "id": "a",
5
+ "role": [
6
+ "paragraph"
7
+ ],
8
+ "text": {
9
+ "plain": "Un",
10
+ "language": "fr"
11
+ }
12
+ },
13
+ {
14
+ "id": "b",
15
+ "role": [
16
+ "paragraph"
17
+ ],
18
+ "text": {
19
+ "plain": "chat",
20
+ "language": "FR"
21
+ }
22
+ },
23
+ {
24
+ "imgref": "a.png",
25
+ "role": [
26
+ "image"
27
+ ],
28
+ "description": {
29
+ "text": {
30
+ "plain": "Un chat",
31
+ "language": "fr"
32
+ }
33
+ }
34
+ }
35
+ ]
36
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><p id="a">Un</p><p id="b" lang="FR">chat</p><img src="a.png" aria-labelledby="a b"></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-labelledby-targets-case",
3
+ "description": "An aria-labelledby description is in its targets' language when their declarations differ only in case",
4
+ "role": "image",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "id": "a",
5
+ "role": [
6
+ "paragraph"
7
+ ],
8
+ "text": {
9
+ "plain": "Un chat",
10
+ "language": "fr"
11
+ }
12
+ },
13
+ {
14
+ "id": "b",
15
+ "role": [
16
+ "paragraph"
17
+ ],
18
+ "text": {
19
+ "plain": "and a dog",
20
+ "language": "en"
21
+ }
22
+ },
23
+ {
24
+ "imgref": "a.png",
25
+ "role": [
26
+ "image"
27
+ ],
28
+ "description": {
29
+ "text": {
30
+ "plain": "Un chat and a dog"
31
+ }
32
+ }
33
+ }
34
+ ]
35
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><p id="a">Un chat</p><p id="b" lang="en">and a dog</p><img src="a.png" aria-labelledby="a b"></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-labelledby-targets-differ",
3
+ "description": "An aria-labelledby description has no language when its targets' languages differ",
4
+ "role": "image",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "id": "link1",
5
+ "text": {
6
+ "ssml": "le <lang xml:lang=\"en\">book</lang>",
7
+ "language": "fr"
8
+ },
9
+ "textref": "b.html"
10
+ }
11
+ ],
12
+ "role": [
13
+ "paragraph"
14
+ ],
15
+ "text": {
16
+ "plain": "Voir le book ici.",
17
+ "ssml": "Voir <readium:link id=\"link1\" /> ici.",
18
+ "language": "fr"
19
+ }
20
+ }
@@ -0,0 +1 @@
1
+ <p lang="fr">Voir <a href="b.html">le <span lang="en">book</span></a> ici.</p>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-link-switches",
3
+ "description": "A language switch inside a link stays in the link's own SSML",
4
+ "role": "link",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "link"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "id": "pagebreak1",
5
+ "role": [
6
+ "pagebreak"
7
+ ],
8
+ "text": {
9
+ "plain": "5",
10
+ "language": "fr"
11
+ }
12
+ }
13
+ ],
14
+ "role": [
15
+ "paragraph"
16
+ ],
17
+ "text": {
18
+ "plain": "Avant après.",
19
+ "ssml": "Avant <readium:pagebreak id=\"pagebreak1\" /> après.",
20
+ "language": "fr"
21
+ }
22
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><p>Avant <span role="doc-pagebreak" title="5"></span> après.</p></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-pagebreak-label",
3
+ "description": "A pagebreak's label is in its element's language",
4
+ "role": "pagebreak",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "pagebreak"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "role": [
5
+ "paragraph"
6
+ ],
7
+ "text": {
8
+ "plain": "Text."
9
+ }
10
+ },
11
+ {
12
+ "imgref": "a.png",
13
+ "role": [
14
+ "image"
15
+ ],
16
+ "description": {
17
+ "text": {
18
+ "plain": "A cat"
19
+ }
20
+ }
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1 @@
1
+ <p>Text.</p><img src="a.png" alt="A cat">
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-undeclared-description",
3
+ "description": "An image's alt has no language when none is declared",
4
+ "role": "image",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "role": [
5
+ "paragraph"
6
+ ],
7
+ "text": {
8
+ "plain": "Texte.",
9
+ "language": "fr"
10
+ }
11
+ },
12
+ {
13
+ "imgref": "a.png",
14
+ "role": [
15
+ "image"
16
+ ],
17
+ "description": {
18
+ "text": {
19
+ "plain": "Un chat",
20
+ "language": "fr"
21
+ }
22
+ }
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><p>Texte.</p><img xml:lang="" src="a.png" alt="Un chat"></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-xml-lang-empty-html-inherits",
3
+ "description": "An empty xml:lang has no effect in HTML, so the inherited language applies",
4
+ "role": "language",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "role": [
5
+ "paragraph"
6
+ ],
7
+ "text": {
8
+ "plain": "Text.",
9
+ "language": "de"
10
+ }
11
+ },
12
+ {
13
+ "imgref": "a.png",
14
+ "role": [
15
+ "image"
16
+ ],
17
+ "description": {
18
+ "text": {
19
+ "plain": "Un chat",
20
+ "language": "fr"
21
+ }
22
+ }
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1 @@
1
+ <div lang="de"><p>Text.</p><img xml:lang="" lang="fr" src="a.png" alt="Un chat"></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-xml-lang-empty-html-lang-applies",
3
+ "description": "An empty xml:lang has no effect in HTML, so lang on the same element applies",
4
+ "role": "language",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "role": [
5
+ "paragraph"
6
+ ],
7
+ "text": {
8
+ "plain": "Text.",
9
+ "language": "de"
10
+ }
11
+ },
12
+ {
13
+ "imgref": "a.png",
14
+ "role": [
15
+ "image"
16
+ ],
17
+ "description": {
18
+ "text": {
19
+ "plain": "Unknown"
20
+ }
21
+ }
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <div xmlns="http://www.w3.org/1999/xhtml" lang="de"><p>Text.</p><img xml:lang="" lang="fr" src="a.png" alt="Unknown"/></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-xml-lang-empty-xhtml",
3
+ "description": "An empty xml:lang in XHTML makes the language unknown, over lang on the same element",
4
+ "role": "language",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "role": [
5
+ "paragraph"
6
+ ],
7
+ "text": {
8
+ "plain": "Texte.",
9
+ "language": "fr"
10
+ }
11
+ },
12
+ {
13
+ "imgref": "a.png",
14
+ "role": [
15
+ "image"
16
+ ],
17
+ "description": {
18
+ "text": {
19
+ "plain": "Katze",
20
+ "language": "de"
21
+ }
22
+ }
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><p>Texte.</p><img xml:lang="de" lang="en" src="a.png" alt="Katze"></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-xml-lang-over-lang",
3
+ "description": "xml:lang wins over lang on the same element",
4
+ "role": "language",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "id": "link1",
5
+ "text": {
6
+ "plain": "coastal map",
7
+ "ssml": "<readium:image id=\"image1\" /> coastal map",
8
+ "language": "en"
9
+ },
10
+ "textref": "map.xhtml",
11
+ "children": [
12
+ {
13
+ "id": "image1",
14
+ "imgref": "images/lighthouse.png",
15
+ "role": [
16
+ "image"
17
+ ],
18
+ "description": {
19
+ "text": {
20
+ "plain": "Lighthouse"
21
+ }
22
+ }
23
+ }
24
+ ]
25
+ }
26
+ ],
27
+ "role": [
28
+ "paragraph"
29
+ ],
30
+ "text": {
31
+ "plain": "See the coastal map for locations.",
32
+ "ssml": "See the <readium:link id=\"link1\" /> for locations.",
33
+ "language": "en"
34
+ }
35
+ }
@@ -0,0 +1 @@
1
+ <p>See the <a href="map.xhtml"><img src="images/lighthouse.png" alt="Lighthouse"/> coastal map</a> for locations.</p>
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": "link-containing-image",
3
+ "description": "An image inside a link is the link's own child, placed in the link's SSML",
4
+ "role": "link",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "link",
8
+ "image"
9
+ ],
10
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
11
+ "inputKind": "fragment"
12
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "id": "link1",
5
+ "text": {
6
+ "plain": "the chapter on daily life at the lighthouse",
7
+ "ssml": "the chapter on daily life at the <readium:pagebreak id=\"page12\" />lighthouse",
8
+ "language": "en"
9
+ },
10
+ "textref": "chapter3.xhtml#logbooks",
11
+ "children": [
12
+ {
13
+ "id": "page12",
14
+ "role": [
15
+ "pagebreak"
16
+ ],
17
+ "text": {
18
+ "plain": "12"
19
+ },
20
+ "textref": "#page12"
21
+ }
22
+ ]
23
+ }
24
+ ],
25
+ "role": [
26
+ "paragraph"
27
+ ],
28
+ "text": {
29
+ "plain": "The logbooks are described in the chapter on daily life at the lighthouse.",
30
+ "ssml": "The logbooks are described in <readium:link id=\"link1\" />.",
31
+ "language": "en"
32
+ }
33
+ }
@@ -0,0 +1 @@
1
+ <p>The logbooks are described in <a href="chapter3.xhtml#logbooks">the chapter on daily life at the <span role="doc-pagebreak" id="page12">12</span>lighthouse</a>.</p>
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": "link-containing-pagebreak",
3
+ "description": "A pagebreak inside a link is the link's own child, its page number kept out of the link's text",
4
+ "role": "link",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "link",
8
+ "pagebreak"
9
+ ],
10
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
11
+ "inputKind": "fragment"
12
+ }