@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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "text": {
3
3
  "language": "en",
4
- "plain": "A text-to-speech system is composed of two parts: a and a.",
4
+ "plain": "A text-to-speech system is composed of two parts: a front-end and a back-end.",
5
5
  "ssml": "A text-to-speech system is composed of two parts: a <readium:glossref id=\"glossref1\" /> and a <readium:glossref id=\"glossref2\" />."
6
6
  },
7
7
  "role": [
@@ -5,16 +5,12 @@
5
5
  {
6
6
  "children": [
7
7
  {
8
- "children": [
9
- {
10
- "role": [
11
- "term"
12
- ],
13
- "text": {
14
- "plain": "Fresnel lens"
15
- }
16
- }
17
- ]
8
+ "role": [
9
+ "term"
10
+ ],
11
+ "text": {
12
+ "plain": "Fresnel lens"
13
+ }
18
14
  },
19
15
  {
20
16
  "role": [
@@ -42,16 +38,12 @@
42
38
  "children": [
43
39
  {
44
40
  "id": "fresnel-lens",
45
- "children": [
46
- {
47
- "role": [
48
- "term"
49
- ],
50
- "text": {
51
- "plain": "Fresnel lens"
52
- }
53
- }
54
- ]
41
+ "role": [
42
+ "term"
43
+ ],
44
+ "text": {
45
+ "plain": "Fresnel lens"
46
+ }
55
47
  },
56
48
  {
57
49
  "role": [
@@ -6,16 +6,12 @@
6
6
  "id": "glossref1",
7
7
  "children": [
8
8
  {
9
- "children": [
10
- {
11
- "role": [
12
- "term"
13
- ],
14
- "text": {
15
- "plain": "Fresnel lens"
16
- }
17
- }
18
- ]
9
+ "role": [
10
+ "term"
11
+ ],
12
+ "text": {
13
+ "plain": "Fresnel lens"
14
+ }
19
15
  },
20
16
  {
21
17
  "role": [
@@ -39,7 +35,7 @@
39
35
  "paragraph"
40
36
  ],
41
37
  "text": {
42
- "plain": "The light passes through a at the top.",
38
+ "plain": "The light passes through a Fresnel lens at the top.",
43
39
  "ssml": "The light passes through a <readium:glossref id=\"glossref1\" /> at the top.",
44
40
  "language": "en"
45
41
  }
@@ -48,16 +44,12 @@
48
44
  "children": [
49
45
  {
50
46
  "id": "fresnel-lens",
51
- "children": [
52
- {
53
- "role": [
54
- "term"
55
- ],
56
- "text": {
57
- "plain": "Fresnel lens"
58
- }
59
- }
60
- ]
47
+ "role": [
48
+ "term"
49
+ ],
50
+ "text": {
51
+ "plain": "Fresnel lens"
52
+ }
61
53
  },
62
54
  {
63
55
  "role": [
@@ -35,7 +35,7 @@
35
35
  "paragraph"
36
36
  ],
37
37
  "text": {
38
- "plain": "A nearby.",
38
+ "plain": "A café nearby.",
39
39
  "ssml": "A <readium:glossref id=\"glossref1\" /> nearby.",
40
40
  "language": "en"
41
41
  }
@@ -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 src="a.png" alt="Un chat"></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-alt-inherited",
3
+ "description": "An image's alt is in the language inherited by its element",
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": "A cat",
20
+ "language": "en"
21
+ }
22
+ }
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><p>Texte.</p><img lang="en" src="a.png" alt="A cat"></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-alt-own-lang",
3
+ "description": "An image's alt is in the language its own element declares",
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,8 @@
1
+ {
2
+ "role": [
3
+ "paragraph"
4
+ ],
5
+ "text": {
6
+ "ssml": "Unknown <lang xml:lang=\"fr\">monde</lang> end."
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ <p lang="">Unknown <span lang="fr">monde</span> end.</p>
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "language-block-empty-lang",
3
+ "description": "A block in an empty lang declaration isn't defaulted to English, while its inline shifts are kept in SSML",
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,49 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "id": "a",
5
+ "role": [
6
+ "paragraph"
7
+ ],
8
+ "text": {
9
+ "plain": "Eine",
10
+ "language": "de"
11
+ }
12
+ },
13
+ {
14
+ "id": "b",
15
+ "role": [
16
+ "paragraph"
17
+ ],
18
+ "text": {
19
+ "plain": "Katze",
20
+ "language": "de"
21
+ }
22
+ },
23
+ {
24
+ "children": [
25
+ {
26
+ "imgref": "a.png",
27
+ "role": [
28
+ "image"
29
+ ],
30
+ "description": {
31
+ "text": {
32
+ "plain": "x",
33
+ "language": "fr"
34
+ }
35
+ }
36
+ }
37
+ ],
38
+ "role": [
39
+ "figure"
40
+ ],
41
+ "description": {
42
+ "text": {
43
+ "plain": "Eine Katze",
44
+ "language": "de"
45
+ }
46
+ }
47
+ }
48
+ ]
49
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><p id="a" lang="de">Eine</p><p id="b" lang="de">Katze</p><figure aria-describedby="a b"><img src="a.png" alt="x"></figure></div>
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": "language-describedby-shared",
3
+ "description": "An aria-describedby description is in its targets' shared language",
4
+ "role": "figure",
5
+ "rolesCovered": [
6
+ "paragraph",
7
+ "figure",
8
+ "image"
9
+ ],
10
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
11
+ "inputKind": "fragment"
12
+ }
@@ -0,0 +1,24 @@
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": "Unknown"
20
+ }
21
+ }
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><p>Texte.</p><img lang="" src="a.png" alt="Unknown"></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-empty-lang-stops-inheritance",
3
+ "description": "An empty lang declaration stops inheritance, leaving an image's alt with no language",
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
+ "imgref": "a.png",
5
+ "role": [
6
+ "image"
7
+ ],
8
+ "description": {
9
+ "text": {
10
+ "plain": "Un chien",
11
+ "language": "fr"
12
+ }
13
+ }
14
+ }
15
+ ],
16
+ "role": [
17
+ "figure"
18
+ ],
19
+ "description": {
20
+ "text": {
21
+ "plain": "A dog",
22
+ "language": "en"
23
+ }
24
+ }
25
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><figure><img src="a.png" alt="Un chien"><figcaption lang="en">A dog</figcaption></figure></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-figcaption",
3
+ "description": "A figure's implicit caption description is in the caption's language",
4
+ "role": "figure",
5
+ "rolesCovered": [
6
+ "figure",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "imgref": "a.png",
5
+ "role": [
6
+ "image"
7
+ ],
8
+ "description": {
9
+ "text": {
10
+ "plain": "x",
11
+ "language": "fr"
12
+ }
13
+ }
14
+ },
15
+ {
16
+ "children": [
17
+ {
18
+ "role": [
19
+ "credit"
20
+ ],
21
+ "text": {
22
+ "plain": "Photo: Jane",
23
+ "language": "en"
24
+ }
25
+ }
26
+ ],
27
+ "role": [
28
+ "caption"
29
+ ]
30
+ }
31
+ ],
32
+ "role": [
33
+ "figure"
34
+ ],
35
+ "description": {
36
+ "text": {
37
+ "plain": "Un chat",
38
+ "language": "fr"
39
+ }
40
+ }
41
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><figure><img src="a.png" alt="x"><figcaption>Un chat <span role="doc-credit" lang="en">Photo: Jane</span></figcaption></figure></div>
@@ -0,0 +1,12 @@
1
+ {
2
+ "id": "language-figcaption-credit",
3
+ "description": "A figure's caption description language ignores a credit spoken separately",
4
+ "role": "figure",
5
+ "rolesCovered": [
6
+ "figure",
7
+ "image",
8
+ "credit"
9
+ ],
10
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
11
+ "inputKind": "fragment"
12
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "children": [
3
+ {
4
+ "imgref": "a.png",
5
+ "role": [
6
+ "image"
7
+ ],
8
+ "description": {
9
+ "text": {
10
+ "plain": "x",
11
+ "language": "fr"
12
+ }
13
+ }
14
+ }
15
+ ],
16
+ "role": [
17
+ "figure"
18
+ ],
19
+ "description": {
20
+ "text": {
21
+ "plain": "Le cat dort"
22
+ }
23
+ }
24
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><figure><img src="a.png" alt="x"><figcaption>Le <i lang="en">cat</i> dort</figcaption></figure></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-figcaption-switches",
3
+ "description": "A figure's caption description has no language when its text switches language",
4
+ "role": "figure",
5
+ "rolesCovered": [
6
+ "figure",
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
+ "imgref": "a.png",
5
+ "role": [
6
+ "image"
7
+ ],
8
+ "description": {
9
+ "text": {
10
+ "plain": "x",
11
+ "language": "fr"
12
+ }
13
+ }
14
+ }
15
+ ],
16
+ "role": [
17
+ "figure"
18
+ ],
19
+ "description": {
20
+ "text": {
21
+ "plain": "A dog",
22
+ "language": "en"
23
+ }
24
+ }
25
+ }
@@ -0,0 +1 @@
1
+ <div lang="fr"><figure><img src="a.png" alt="x"><figcaption> <span lang="en">A dog</span> </figcaption></figure></div>
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "language-figcaption-switches-throughout",
3
+ "description": "A figure's caption description is in the language its text switches to throughout",
4
+ "role": "figure",
5
+ "rolesCovered": [
6
+ "figure",
7
+ "image"
8
+ ],
9
+ "sourceRef": "https://github.com/readium/guided-navigation/tree/main/examples/read-aloud",
10
+ "inputKind": "fragment"
11
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "role": [
3
+ "paragraph"
4
+ ],
5
+ "text": {
6
+ "plain": "Hello world end.",
7
+ "language": "en"
8
+ }
9
+ }
@@ -0,0 +1 @@
1
+ <p lang="en">Hello <span lang="EN">world</span> end.</p>
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "language-inline-case-insensitive",
3
+ "description": "Inline language declarations differing only in case from the block's are the same language: no SSML shift",
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,9 @@
1
+ {
2
+ "role": [
3
+ "paragraph"
4
+ ],
5
+ "text": {
6
+ "ssml": "Hello world <emphasis>end</emphasis>.",
7
+ "language": "en-us"
8
+ }
9
+ }
@@ -0,0 +1 @@
1
+ <p lang="en-us">Hello <span lang="en-US">world</span> <em lang="EN-US">end</em>.</p>
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "language-inline-case-insensitive-ssml",
3
+ "description": "Inline language declarations differing only in case are not tagged as shifts in SSML produced for other reasons",
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,9 @@
1
+ {
2
+ "role": [
3
+ "paragraph"
4
+ ],
5
+ "text": {
6
+ "ssml": "Bonjour <lang xml:lang=\"\">xyz</lang> fin.",
7
+ "language": "fr"
8
+ }
9
+ }
@@ -0,0 +1 @@
1
+ <p lang="fr">Bonjour <span lang="">xyz</span> fin.</p>
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "language-inline-empty-lang",
3
+ "description": "An empty lang declaration inside a known language is an explicit language shift in SSML",
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,8 @@
1
+ {
2
+ "role": [
3
+ "paragraph"
4
+ ],
5
+ "text": {
6
+ "ssml": "<emphasis>xyz</emphasis>"
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ <p lang="fr"><span lang=""><em>xyz</em></span></p>
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "language-inline-empty-lang-formatted",
3
+ "description": "Formatted text only in an empty lang declaration has no language",
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,8 @@
1
+ {
2
+ "role": [
3
+ "paragraph"
4
+ ],
5
+ "text": {
6
+ "plain": "xyz"
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ <p lang="fr"><span lang="">xyz</span></p>
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "language-inline-empty-lang-only",
3
+ "description": "Text only in an empty lang declaration has no language",
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
+ }