@instructure/outcomes-ui 3.2.3 → 3.2.5

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 (481) hide show
  1. package/es/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  2. package/es/components/OutcomeCheckbox/index.js +1 -0
  3. package/es/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  4. package/es/components/OutcomeSelectionList/index.js +1 -0
  5. package/es/lib/__tests__/sanitize.test.js +132 -10
  6. package/es/lib/sanitize.js +22 -26
  7. package/es/translated/ar/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  8. package/es/translated/ar/components/OutcomeCheckbox/index.js +1 -0
  9. package/es/translated/ar/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  10. package/es/translated/ar/components/OutcomeSelectionList/index.js +1 -0
  11. package/es/translated/ar/lib/__tests__/sanitize.test.js +132 -10
  12. package/es/translated/ar/lib/sanitize.js +22 -26
  13. package/es/translated/ca/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  14. package/es/translated/ca/components/OutcomeCheckbox/index.js +1 -0
  15. package/es/translated/ca/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  16. package/es/translated/ca/components/OutcomeSelectionList/index.js +1 -0
  17. package/es/translated/ca/lib/__tests__/sanitize.test.js +132 -10
  18. package/es/translated/ca/lib/sanitize.js +22 -26
  19. package/es/translated/cy/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  20. package/es/translated/cy/components/OutcomeCheckbox/index.js +1 -0
  21. package/es/translated/cy/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  22. package/es/translated/cy/components/OutcomeSelectionList/index.js +1 -0
  23. package/es/translated/cy/lib/__tests__/sanitize.test.js +132 -10
  24. package/es/translated/cy/lib/sanitize.js +22 -26
  25. package/es/translated/da/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  26. package/es/translated/da/components/OutcomeCheckbox/index.js +1 -0
  27. package/es/translated/da/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  28. package/es/translated/da/components/OutcomeSelectionList/index.js +1 -0
  29. package/es/translated/da/lib/__tests__/sanitize.test.js +132 -10
  30. package/es/translated/da/lib/sanitize.js +22 -26
  31. package/es/translated/da-x-k12/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  32. package/es/translated/da-x-k12/components/OutcomeCheckbox/index.js +1 -0
  33. package/es/translated/da-x-k12/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  34. package/es/translated/da-x-k12/components/OutcomeSelectionList/index.js +1 -0
  35. package/es/translated/da-x-k12/lib/__tests__/sanitize.test.js +132 -10
  36. package/es/translated/da-x-k12/lib/sanitize.js +22 -26
  37. package/es/translated/de/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  38. package/es/translated/de/components/OutcomeCheckbox/index.js +1 -0
  39. package/es/translated/de/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  40. package/es/translated/de/components/OutcomeSelectionList/index.js +1 -0
  41. package/es/translated/de/lib/__tests__/sanitize.test.js +132 -10
  42. package/es/translated/de/lib/sanitize.js +22 -26
  43. package/es/translated/en/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  44. package/es/translated/en/components/OutcomeCheckbox/index.js +1 -0
  45. package/es/translated/en/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  46. package/es/translated/en/components/OutcomeSelectionList/index.js +1 -0
  47. package/es/translated/en/lib/__tests__/sanitize.test.js +132 -10
  48. package/es/translated/en/lib/sanitize.js +22 -26
  49. package/es/translated/en-AU/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  50. package/es/translated/en-AU/components/OutcomeCheckbox/index.js +1 -0
  51. package/es/translated/en-AU/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  52. package/es/translated/en-AU/components/OutcomeSelectionList/index.js +1 -0
  53. package/es/translated/en-AU/lib/__tests__/sanitize.test.js +132 -10
  54. package/es/translated/en-AU/lib/sanitize.js +22 -26
  55. package/es/translated/en-AU-x-unimelb/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  56. package/es/translated/en-AU-x-unimelb/components/OutcomeCheckbox/index.js +1 -0
  57. package/es/translated/en-AU-x-unimelb/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  58. package/es/translated/en-AU-x-unimelb/components/OutcomeSelectionList/index.js +1 -0
  59. package/es/translated/en-AU-x-unimelb/lib/__tests__/sanitize.test.js +132 -10
  60. package/es/translated/en-AU-x-unimelb/lib/sanitize.js +22 -26
  61. package/es/translated/en-CA/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  62. package/es/translated/en-CA/components/OutcomeCheckbox/index.js +1 -0
  63. package/es/translated/en-CA/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  64. package/es/translated/en-CA/components/OutcomeSelectionList/index.js +1 -0
  65. package/es/translated/en-CA/lib/__tests__/sanitize.test.js +132 -10
  66. package/es/translated/en-CA/lib/sanitize.js +22 -26
  67. package/es/translated/en-CY/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  68. package/es/translated/en-CY/components/OutcomeCheckbox/index.js +1 -0
  69. package/es/translated/en-CY/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  70. package/es/translated/en-CY/components/OutcomeSelectionList/index.js +1 -0
  71. package/es/translated/en-CY/lib/__tests__/sanitize.test.js +132 -10
  72. package/es/translated/en-CY/lib/sanitize.js +22 -26
  73. package/es/translated/en-GB/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  74. package/es/translated/en-GB/components/OutcomeCheckbox/index.js +1 -0
  75. package/es/translated/en-GB/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  76. package/es/translated/en-GB/components/OutcomeSelectionList/index.js +1 -0
  77. package/es/translated/en-GB/lib/__tests__/sanitize.test.js +132 -10
  78. package/es/translated/en-GB/lib/sanitize.js +22 -26
  79. package/es/translated/en-GB-x-ukhe/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  80. package/es/translated/en-GB-x-ukhe/components/OutcomeCheckbox/index.js +1 -0
  81. package/es/translated/en-GB-x-ukhe/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  82. package/es/translated/en-GB-x-ukhe/components/OutcomeSelectionList/index.js +1 -0
  83. package/es/translated/en-GB-x-ukhe/lib/__tests__/sanitize.test.js +132 -10
  84. package/es/translated/en-GB-x-ukhe/lib/sanitize.js +22 -26
  85. package/es/translated/en-IE/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  86. package/es/translated/en-IE/components/OutcomeCheckbox/index.js +1 -0
  87. package/es/translated/en-IE/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  88. package/es/translated/en-IE/components/OutcomeSelectionList/index.js +1 -0
  89. package/es/translated/en-IE/lib/__tests__/sanitize.test.js +132 -10
  90. package/es/translated/en-IE/lib/sanitize.js +22 -26
  91. package/es/translated/es/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  92. package/es/translated/es/components/OutcomeCheckbox/index.js +1 -0
  93. package/es/translated/es/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  94. package/es/translated/es/components/OutcomeSelectionList/index.js +1 -0
  95. package/es/translated/es/lib/__tests__/sanitize.test.js +132 -10
  96. package/es/translated/es/lib/sanitize.js +22 -26
  97. package/es/translated/es-ES/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  98. package/es/translated/es-ES/components/OutcomeCheckbox/index.js +1 -0
  99. package/es/translated/es-ES/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  100. package/es/translated/es-ES/components/OutcomeSelectionList/index.js +1 -0
  101. package/es/translated/es-ES/lib/__tests__/sanitize.test.js +132 -10
  102. package/es/translated/es-ES/lib/sanitize.js +22 -26
  103. package/es/translated/es_ES/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  104. package/es/translated/es_ES/components/OutcomeCheckbox/index.js +1 -0
  105. package/es/translated/es_ES/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  106. package/es/translated/es_ES/components/OutcomeSelectionList/index.js +1 -0
  107. package/es/translated/es_ES/lib/__tests__/sanitize.test.js +132 -10
  108. package/es/translated/es_ES/lib/sanitize.js +22 -26
  109. package/es/translated/fi/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  110. package/es/translated/fi/components/OutcomeCheckbox/index.js +1 -0
  111. package/es/translated/fi/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  112. package/es/translated/fi/components/OutcomeSelectionList/index.js +1 -0
  113. package/es/translated/fi/lib/__tests__/sanitize.test.js +132 -10
  114. package/es/translated/fi/lib/sanitize.js +22 -26
  115. package/es/translated/fr/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  116. package/es/translated/fr/components/OutcomeCheckbox/index.js +1 -0
  117. package/es/translated/fr/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  118. package/es/translated/fr/components/OutcomeSelectionList/index.js +1 -0
  119. package/es/translated/fr/lib/__tests__/sanitize.test.js +132 -10
  120. package/es/translated/fr/lib/sanitize.js +22 -26
  121. package/es/translated/fr-CA/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  122. package/es/translated/fr-CA/components/OutcomeCheckbox/index.js +1 -0
  123. package/es/translated/fr-CA/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  124. package/es/translated/fr-CA/components/OutcomeSelectionList/index.js +1 -0
  125. package/es/translated/fr-CA/lib/__tests__/sanitize.test.js +132 -10
  126. package/es/translated/fr-CA/lib/sanitize.js +22 -26
  127. package/es/translated/ht/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  128. package/es/translated/ht/components/OutcomeCheckbox/index.js +1 -0
  129. package/es/translated/ht/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  130. package/es/translated/ht/components/OutcomeSelectionList/index.js +1 -0
  131. package/es/translated/ht/lib/__tests__/sanitize.test.js +132 -10
  132. package/es/translated/ht/lib/sanitize.js +22 -26
  133. package/es/translated/is/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  134. package/es/translated/is/components/OutcomeCheckbox/index.js +1 -0
  135. package/es/translated/is/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  136. package/es/translated/is/components/OutcomeSelectionList/index.js +1 -0
  137. package/es/translated/is/lib/__tests__/sanitize.test.js +132 -10
  138. package/es/translated/is/lib/sanitize.js +22 -26
  139. package/es/translated/it/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  140. package/es/translated/it/components/OutcomeCheckbox/index.js +1 -0
  141. package/es/translated/it/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  142. package/es/translated/it/components/OutcomeSelectionList/index.js +1 -0
  143. package/es/translated/it/lib/__tests__/sanitize.test.js +132 -10
  144. package/es/translated/it/lib/sanitize.js +22 -26
  145. package/es/translated/ja/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  146. package/es/translated/ja/components/OutcomeCheckbox/index.js +1 -0
  147. package/es/translated/ja/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  148. package/es/translated/ja/components/OutcomeSelectionList/index.js +1 -0
  149. package/es/translated/ja/lib/__tests__/sanitize.test.js +132 -10
  150. package/es/translated/ja/lib/sanitize.js +22 -26
  151. package/es/translated/mi/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  152. package/es/translated/mi/components/OutcomeCheckbox/index.js +1 -0
  153. package/es/translated/mi/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  154. package/es/translated/mi/components/OutcomeSelectionList/index.js +1 -0
  155. package/es/translated/mi/lib/__tests__/sanitize.test.js +132 -10
  156. package/es/translated/mi/lib/sanitize.js +22 -26
  157. package/es/translated/nb/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  158. package/es/translated/nb/components/OutcomeCheckbox/index.js +1 -0
  159. package/es/translated/nb/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  160. package/es/translated/nb/components/OutcomeSelectionList/index.js +1 -0
  161. package/es/translated/nb/lib/__tests__/sanitize.test.js +132 -10
  162. package/es/translated/nb/lib/sanitize.js +22 -26
  163. package/es/translated/nb-x-k12/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  164. package/es/translated/nb-x-k12/components/OutcomeCheckbox/index.js +1 -0
  165. package/es/translated/nb-x-k12/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  166. package/es/translated/nb-x-k12/components/OutcomeSelectionList/index.js +1 -0
  167. package/es/translated/nb-x-k12/lib/__tests__/sanitize.test.js +132 -10
  168. package/es/translated/nb-x-k12/lib/sanitize.js +22 -26
  169. package/es/translated/nl/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  170. package/es/translated/nl/components/OutcomeCheckbox/index.js +1 -0
  171. package/es/translated/nl/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  172. package/es/translated/nl/components/OutcomeSelectionList/index.js +1 -0
  173. package/es/translated/nl/lib/__tests__/sanitize.test.js +132 -10
  174. package/es/translated/nl/lib/sanitize.js +22 -26
  175. package/es/translated/pl/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  176. package/es/translated/pl/components/OutcomeCheckbox/index.js +1 -0
  177. package/es/translated/pl/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  178. package/es/translated/pl/components/OutcomeSelectionList/index.js +1 -0
  179. package/es/translated/pl/lib/__tests__/sanitize.test.js +132 -10
  180. package/es/translated/pl/lib/sanitize.js +22 -26
  181. package/es/translated/pt/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  182. package/es/translated/pt/components/OutcomeCheckbox/index.js +1 -0
  183. package/es/translated/pt/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  184. package/es/translated/pt/components/OutcomeSelectionList/index.js +1 -0
  185. package/es/translated/pt/lib/__tests__/sanitize.test.js +132 -10
  186. package/es/translated/pt/lib/sanitize.js +22 -26
  187. package/es/translated/pt-BR/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  188. package/es/translated/pt-BR/components/OutcomeCheckbox/index.js +1 -0
  189. package/es/translated/pt-BR/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  190. package/es/translated/pt-BR/components/OutcomeSelectionList/index.js +1 -0
  191. package/es/translated/pt-BR/lib/__tests__/sanitize.test.js +132 -10
  192. package/es/translated/pt-BR/lib/sanitize.js +22 -26
  193. package/es/translated/ru/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  194. package/es/translated/ru/components/OutcomeCheckbox/index.js +1 -0
  195. package/es/translated/ru/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  196. package/es/translated/ru/components/OutcomeSelectionList/index.js +1 -0
  197. package/es/translated/ru/lib/__tests__/sanitize.test.js +132 -10
  198. package/es/translated/ru/lib/sanitize.js +22 -26
  199. package/es/translated/sl/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  200. package/es/translated/sl/components/OutcomeCheckbox/index.js +1 -0
  201. package/es/translated/sl/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  202. package/es/translated/sl/components/OutcomeSelectionList/index.js +1 -0
  203. package/es/translated/sl/lib/__tests__/sanitize.test.js +132 -10
  204. package/es/translated/sl/lib/sanitize.js +22 -26
  205. package/es/translated/sv/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  206. package/es/translated/sv/components/OutcomeCheckbox/index.js +1 -0
  207. package/es/translated/sv/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  208. package/es/translated/sv/components/OutcomeSelectionList/index.js +1 -0
  209. package/es/translated/sv/lib/__tests__/sanitize.test.js +132 -10
  210. package/es/translated/sv/lib/sanitize.js +22 -26
  211. package/es/translated/sv-x-k12/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  212. package/es/translated/sv-x-k12/components/OutcomeCheckbox/index.js +1 -0
  213. package/es/translated/sv-x-k12/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  214. package/es/translated/sv-x-k12/components/OutcomeSelectionList/index.js +1 -0
  215. package/es/translated/sv-x-k12/lib/__tests__/sanitize.test.js +132 -10
  216. package/es/translated/sv-x-k12/lib/sanitize.js +22 -26
  217. package/es/translated/th/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  218. package/es/translated/th/components/OutcomeCheckbox/index.js +1 -0
  219. package/es/translated/th/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  220. package/es/translated/th/components/OutcomeSelectionList/index.js +1 -0
  221. package/es/translated/th/lib/__tests__/sanitize.test.js +132 -10
  222. package/es/translated/th/lib/sanitize.js +22 -26
  223. package/es/translated/vi/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  224. package/es/translated/vi/components/OutcomeCheckbox/index.js +1 -0
  225. package/es/translated/vi/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  226. package/es/translated/vi/components/OutcomeSelectionList/index.js +1 -0
  227. package/es/translated/vi/lib/__tests__/sanitize.test.js +132 -10
  228. package/es/translated/vi/lib/sanitize.js +22 -26
  229. package/es/translated/zh-Hans/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  230. package/es/translated/zh-Hans/components/OutcomeCheckbox/index.js +1 -0
  231. package/es/translated/zh-Hans/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  232. package/es/translated/zh-Hans/components/OutcomeSelectionList/index.js +1 -0
  233. package/es/translated/zh-Hans/lib/__tests__/sanitize.test.js +132 -10
  234. package/es/translated/zh-Hans/lib/sanitize.js +22 -26
  235. package/es/translated/zh-Hant/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  236. package/es/translated/zh-Hant/components/OutcomeCheckbox/index.js +1 -0
  237. package/es/translated/zh-Hant/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  238. package/es/translated/zh-Hant/components/OutcomeSelectionList/index.js +1 -0
  239. package/es/translated/zh-Hant/lib/__tests__/sanitize.test.js +132 -10
  240. package/es/translated/zh-Hant/lib/sanitize.js +22 -26
  241. package/lib/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  242. package/lib/components/OutcomeCheckbox/index.js +1 -0
  243. package/lib/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  244. package/lib/components/OutcomeSelectionList/index.js +1 -0
  245. package/lib/lib/__tests__/sanitize.test.js +132 -10
  246. package/lib/lib/sanitize.js +22 -26
  247. package/lib/translated/ar/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  248. package/lib/translated/ar/components/OutcomeCheckbox/index.js +1 -0
  249. package/lib/translated/ar/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  250. package/lib/translated/ar/components/OutcomeSelectionList/index.js +1 -0
  251. package/lib/translated/ar/lib/__tests__/sanitize.test.js +132 -10
  252. package/lib/translated/ar/lib/sanitize.js +22 -26
  253. package/lib/translated/ca/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  254. package/lib/translated/ca/components/OutcomeCheckbox/index.js +1 -0
  255. package/lib/translated/ca/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  256. package/lib/translated/ca/components/OutcomeSelectionList/index.js +1 -0
  257. package/lib/translated/ca/lib/__tests__/sanitize.test.js +132 -10
  258. package/lib/translated/ca/lib/sanitize.js +22 -26
  259. package/lib/translated/cy/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  260. package/lib/translated/cy/components/OutcomeCheckbox/index.js +1 -0
  261. package/lib/translated/cy/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  262. package/lib/translated/cy/components/OutcomeSelectionList/index.js +1 -0
  263. package/lib/translated/cy/lib/__tests__/sanitize.test.js +132 -10
  264. package/lib/translated/cy/lib/sanitize.js +22 -26
  265. package/lib/translated/da/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  266. package/lib/translated/da/components/OutcomeCheckbox/index.js +1 -0
  267. package/lib/translated/da/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  268. package/lib/translated/da/components/OutcomeSelectionList/index.js +1 -0
  269. package/lib/translated/da/lib/__tests__/sanitize.test.js +132 -10
  270. package/lib/translated/da/lib/sanitize.js +22 -26
  271. package/lib/translated/da-x-k12/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  272. package/lib/translated/da-x-k12/components/OutcomeCheckbox/index.js +1 -0
  273. package/lib/translated/da-x-k12/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  274. package/lib/translated/da-x-k12/components/OutcomeSelectionList/index.js +1 -0
  275. package/lib/translated/da-x-k12/lib/__tests__/sanitize.test.js +132 -10
  276. package/lib/translated/da-x-k12/lib/sanitize.js +22 -26
  277. package/lib/translated/de/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  278. package/lib/translated/de/components/OutcomeCheckbox/index.js +1 -0
  279. package/lib/translated/de/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  280. package/lib/translated/de/components/OutcomeSelectionList/index.js +1 -0
  281. package/lib/translated/de/lib/__tests__/sanitize.test.js +132 -10
  282. package/lib/translated/de/lib/sanitize.js +22 -26
  283. package/lib/translated/en/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  284. package/lib/translated/en/components/OutcomeCheckbox/index.js +1 -0
  285. package/lib/translated/en/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  286. package/lib/translated/en/components/OutcomeSelectionList/index.js +1 -0
  287. package/lib/translated/en/lib/__tests__/sanitize.test.js +132 -10
  288. package/lib/translated/en/lib/sanitize.js +22 -26
  289. package/lib/translated/en-AU/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  290. package/lib/translated/en-AU/components/OutcomeCheckbox/index.js +1 -0
  291. package/lib/translated/en-AU/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  292. package/lib/translated/en-AU/components/OutcomeSelectionList/index.js +1 -0
  293. package/lib/translated/en-AU/lib/__tests__/sanitize.test.js +132 -10
  294. package/lib/translated/en-AU/lib/sanitize.js +22 -26
  295. package/lib/translated/en-AU-x-unimelb/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  296. package/lib/translated/en-AU-x-unimelb/components/OutcomeCheckbox/index.js +1 -0
  297. package/lib/translated/en-AU-x-unimelb/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  298. package/lib/translated/en-AU-x-unimelb/components/OutcomeSelectionList/index.js +1 -0
  299. package/lib/translated/en-AU-x-unimelb/lib/__tests__/sanitize.test.js +132 -10
  300. package/lib/translated/en-AU-x-unimelb/lib/sanitize.js +22 -26
  301. package/lib/translated/en-CA/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  302. package/lib/translated/en-CA/components/OutcomeCheckbox/index.js +1 -0
  303. package/lib/translated/en-CA/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  304. package/lib/translated/en-CA/components/OutcomeSelectionList/index.js +1 -0
  305. package/lib/translated/en-CA/lib/__tests__/sanitize.test.js +132 -10
  306. package/lib/translated/en-CA/lib/sanitize.js +22 -26
  307. package/lib/translated/en-CY/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  308. package/lib/translated/en-CY/components/OutcomeCheckbox/index.js +1 -0
  309. package/lib/translated/en-CY/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  310. package/lib/translated/en-CY/components/OutcomeSelectionList/index.js +1 -0
  311. package/lib/translated/en-CY/lib/__tests__/sanitize.test.js +132 -10
  312. package/lib/translated/en-CY/lib/sanitize.js +22 -26
  313. package/lib/translated/en-GB/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  314. package/lib/translated/en-GB/components/OutcomeCheckbox/index.js +1 -0
  315. package/lib/translated/en-GB/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  316. package/lib/translated/en-GB/components/OutcomeSelectionList/index.js +1 -0
  317. package/lib/translated/en-GB/lib/__tests__/sanitize.test.js +132 -10
  318. package/lib/translated/en-GB/lib/sanitize.js +22 -26
  319. package/lib/translated/en-GB-x-ukhe/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  320. package/lib/translated/en-GB-x-ukhe/components/OutcomeCheckbox/index.js +1 -0
  321. package/lib/translated/en-GB-x-ukhe/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  322. package/lib/translated/en-GB-x-ukhe/components/OutcomeSelectionList/index.js +1 -0
  323. package/lib/translated/en-GB-x-ukhe/lib/__tests__/sanitize.test.js +132 -10
  324. package/lib/translated/en-GB-x-ukhe/lib/sanitize.js +22 -26
  325. package/lib/translated/en-IE/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  326. package/lib/translated/en-IE/components/OutcomeCheckbox/index.js +1 -0
  327. package/lib/translated/en-IE/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  328. package/lib/translated/en-IE/components/OutcomeSelectionList/index.js +1 -0
  329. package/lib/translated/en-IE/lib/__tests__/sanitize.test.js +132 -10
  330. package/lib/translated/en-IE/lib/sanitize.js +22 -26
  331. package/lib/translated/es/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  332. package/lib/translated/es/components/OutcomeCheckbox/index.js +1 -0
  333. package/lib/translated/es/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  334. package/lib/translated/es/components/OutcomeSelectionList/index.js +1 -0
  335. package/lib/translated/es/lib/__tests__/sanitize.test.js +132 -10
  336. package/lib/translated/es/lib/sanitize.js +22 -26
  337. package/lib/translated/es-ES/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  338. package/lib/translated/es-ES/components/OutcomeCheckbox/index.js +1 -0
  339. package/lib/translated/es-ES/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  340. package/lib/translated/es-ES/components/OutcomeSelectionList/index.js +1 -0
  341. package/lib/translated/es-ES/lib/__tests__/sanitize.test.js +132 -10
  342. package/lib/translated/es-ES/lib/sanitize.js +22 -26
  343. package/lib/translated/es_ES/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  344. package/lib/translated/es_ES/components/OutcomeCheckbox/index.js +1 -0
  345. package/lib/translated/es_ES/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  346. package/lib/translated/es_ES/components/OutcomeSelectionList/index.js +1 -0
  347. package/lib/translated/es_ES/lib/__tests__/sanitize.test.js +132 -10
  348. package/lib/translated/es_ES/lib/sanitize.js +22 -26
  349. package/lib/translated/fi/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  350. package/lib/translated/fi/components/OutcomeCheckbox/index.js +1 -0
  351. package/lib/translated/fi/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  352. package/lib/translated/fi/components/OutcomeSelectionList/index.js +1 -0
  353. package/lib/translated/fi/lib/__tests__/sanitize.test.js +132 -10
  354. package/lib/translated/fi/lib/sanitize.js +22 -26
  355. package/lib/translated/fr/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  356. package/lib/translated/fr/components/OutcomeCheckbox/index.js +1 -0
  357. package/lib/translated/fr/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  358. package/lib/translated/fr/components/OutcomeSelectionList/index.js +1 -0
  359. package/lib/translated/fr/lib/__tests__/sanitize.test.js +132 -10
  360. package/lib/translated/fr/lib/sanitize.js +22 -26
  361. package/lib/translated/fr-CA/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  362. package/lib/translated/fr-CA/components/OutcomeCheckbox/index.js +1 -0
  363. package/lib/translated/fr-CA/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  364. package/lib/translated/fr-CA/components/OutcomeSelectionList/index.js +1 -0
  365. package/lib/translated/fr-CA/lib/__tests__/sanitize.test.js +132 -10
  366. package/lib/translated/fr-CA/lib/sanitize.js +22 -26
  367. package/lib/translated/ht/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  368. package/lib/translated/ht/components/OutcomeCheckbox/index.js +1 -0
  369. package/lib/translated/ht/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  370. package/lib/translated/ht/components/OutcomeSelectionList/index.js +1 -0
  371. package/lib/translated/ht/lib/__tests__/sanitize.test.js +132 -10
  372. package/lib/translated/ht/lib/sanitize.js +22 -26
  373. package/lib/translated/is/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  374. package/lib/translated/is/components/OutcomeCheckbox/index.js +1 -0
  375. package/lib/translated/is/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  376. package/lib/translated/is/components/OutcomeSelectionList/index.js +1 -0
  377. package/lib/translated/is/lib/__tests__/sanitize.test.js +132 -10
  378. package/lib/translated/is/lib/sanitize.js +22 -26
  379. package/lib/translated/it/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  380. package/lib/translated/it/components/OutcomeCheckbox/index.js +1 -0
  381. package/lib/translated/it/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  382. package/lib/translated/it/components/OutcomeSelectionList/index.js +1 -0
  383. package/lib/translated/it/lib/__tests__/sanitize.test.js +132 -10
  384. package/lib/translated/it/lib/sanitize.js +22 -26
  385. package/lib/translated/ja/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  386. package/lib/translated/ja/components/OutcomeCheckbox/index.js +1 -0
  387. package/lib/translated/ja/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  388. package/lib/translated/ja/components/OutcomeSelectionList/index.js +1 -0
  389. package/lib/translated/ja/lib/__tests__/sanitize.test.js +132 -10
  390. package/lib/translated/ja/lib/sanitize.js +22 -26
  391. package/lib/translated/mi/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  392. package/lib/translated/mi/components/OutcomeCheckbox/index.js +1 -0
  393. package/lib/translated/mi/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  394. package/lib/translated/mi/components/OutcomeSelectionList/index.js +1 -0
  395. package/lib/translated/mi/lib/__tests__/sanitize.test.js +132 -10
  396. package/lib/translated/mi/lib/sanitize.js +22 -26
  397. package/lib/translated/nb/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  398. package/lib/translated/nb/components/OutcomeCheckbox/index.js +1 -0
  399. package/lib/translated/nb/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  400. package/lib/translated/nb/components/OutcomeSelectionList/index.js +1 -0
  401. package/lib/translated/nb/lib/__tests__/sanitize.test.js +132 -10
  402. package/lib/translated/nb/lib/sanitize.js +22 -26
  403. package/lib/translated/nb-x-k12/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  404. package/lib/translated/nb-x-k12/components/OutcomeCheckbox/index.js +1 -0
  405. package/lib/translated/nb-x-k12/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  406. package/lib/translated/nb-x-k12/components/OutcomeSelectionList/index.js +1 -0
  407. package/lib/translated/nb-x-k12/lib/__tests__/sanitize.test.js +132 -10
  408. package/lib/translated/nb-x-k12/lib/sanitize.js +22 -26
  409. package/lib/translated/nl/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  410. package/lib/translated/nl/components/OutcomeCheckbox/index.js +1 -0
  411. package/lib/translated/nl/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  412. package/lib/translated/nl/components/OutcomeSelectionList/index.js +1 -0
  413. package/lib/translated/nl/lib/__tests__/sanitize.test.js +132 -10
  414. package/lib/translated/nl/lib/sanitize.js +22 -26
  415. package/lib/translated/pl/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  416. package/lib/translated/pl/components/OutcomeCheckbox/index.js +1 -0
  417. package/lib/translated/pl/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  418. package/lib/translated/pl/components/OutcomeSelectionList/index.js +1 -0
  419. package/lib/translated/pl/lib/__tests__/sanitize.test.js +132 -10
  420. package/lib/translated/pl/lib/sanitize.js +22 -26
  421. package/lib/translated/pt/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  422. package/lib/translated/pt/components/OutcomeCheckbox/index.js +1 -0
  423. package/lib/translated/pt/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  424. package/lib/translated/pt/components/OutcomeSelectionList/index.js +1 -0
  425. package/lib/translated/pt/lib/__tests__/sanitize.test.js +132 -10
  426. package/lib/translated/pt/lib/sanitize.js +22 -26
  427. package/lib/translated/pt-BR/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  428. package/lib/translated/pt-BR/components/OutcomeCheckbox/index.js +1 -0
  429. package/lib/translated/pt-BR/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  430. package/lib/translated/pt-BR/components/OutcomeSelectionList/index.js +1 -0
  431. package/lib/translated/pt-BR/lib/__tests__/sanitize.test.js +132 -10
  432. package/lib/translated/pt-BR/lib/sanitize.js +22 -26
  433. package/lib/translated/ru/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  434. package/lib/translated/ru/components/OutcomeCheckbox/index.js +1 -0
  435. package/lib/translated/ru/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  436. package/lib/translated/ru/components/OutcomeSelectionList/index.js +1 -0
  437. package/lib/translated/ru/lib/__tests__/sanitize.test.js +132 -10
  438. package/lib/translated/ru/lib/sanitize.js +22 -26
  439. package/lib/translated/sl/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  440. package/lib/translated/sl/components/OutcomeCheckbox/index.js +1 -0
  441. package/lib/translated/sl/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  442. package/lib/translated/sl/components/OutcomeSelectionList/index.js +1 -0
  443. package/lib/translated/sl/lib/__tests__/sanitize.test.js +132 -10
  444. package/lib/translated/sl/lib/sanitize.js +22 -26
  445. package/lib/translated/sv/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  446. package/lib/translated/sv/components/OutcomeCheckbox/index.js +1 -0
  447. package/lib/translated/sv/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  448. package/lib/translated/sv/components/OutcomeSelectionList/index.js +1 -0
  449. package/lib/translated/sv/lib/__tests__/sanitize.test.js +132 -10
  450. package/lib/translated/sv/lib/sanitize.js +22 -26
  451. package/lib/translated/sv-x-k12/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  452. package/lib/translated/sv-x-k12/components/OutcomeCheckbox/index.js +1 -0
  453. package/lib/translated/sv-x-k12/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  454. package/lib/translated/sv-x-k12/components/OutcomeSelectionList/index.js +1 -0
  455. package/lib/translated/sv-x-k12/lib/__tests__/sanitize.test.js +132 -10
  456. package/lib/translated/sv-x-k12/lib/sanitize.js +22 -26
  457. package/lib/translated/th/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  458. package/lib/translated/th/components/OutcomeCheckbox/index.js +1 -0
  459. package/lib/translated/th/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  460. package/lib/translated/th/components/OutcomeSelectionList/index.js +1 -0
  461. package/lib/translated/th/lib/__tests__/sanitize.test.js +132 -10
  462. package/lib/translated/th/lib/sanitize.js +22 -26
  463. package/lib/translated/vi/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  464. package/lib/translated/vi/components/OutcomeCheckbox/index.js +1 -0
  465. package/lib/translated/vi/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  466. package/lib/translated/vi/components/OutcomeSelectionList/index.js +1 -0
  467. package/lib/translated/vi/lib/__tests__/sanitize.test.js +132 -10
  468. package/lib/translated/vi/lib/sanitize.js +22 -26
  469. package/lib/translated/zh-Hans/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  470. package/lib/translated/zh-Hans/components/OutcomeCheckbox/index.js +1 -0
  471. package/lib/translated/zh-Hans/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  472. package/lib/translated/zh-Hans/components/OutcomeSelectionList/index.js +1 -0
  473. package/lib/translated/zh-Hans/lib/__tests__/sanitize.test.js +132 -10
  474. package/lib/translated/zh-Hans/lib/sanitize.js +22 -26
  475. package/lib/translated/zh-Hant/components/OutcomeCheckbox/__tests__/index.test.js +5 -2
  476. package/lib/translated/zh-Hant/components/OutcomeCheckbox/index.js +1 -0
  477. package/lib/translated/zh-Hant/components/OutcomeSelectionList/__tests__/index.test.js +1 -0
  478. package/lib/translated/zh-Hant/components/OutcomeSelectionList/index.js +1 -0
  479. package/lib/translated/zh-Hant/lib/__tests__/sanitize.test.js +132 -10
  480. package/lib/translated/zh-Hant/lib/sanitize.js +22 -26
  481. package/package.json +3 -3
@@ -2,17 +2,139 @@
2
2
 
3
3
  var _chai = require("chai");
4
4
  var _sanitize = require("../sanitize.js");
5
- describe('sanitizeForHtml', function () {
6
- it('cleans invalid tags', function () {
7
- var invalid = '<monkey>tag isn\'t closed';
8
- (0, _chai.expect)((0, _sanitize.sanitizeHtml)(invalid)).to.include('</monkey>');
5
+ describe('sanitizeHtml', function () {
6
+ describe('equation images (Canvas-specific)', function () {
7
+ it('rewrites /equation_images src to absolute canvas URL', function () {
8
+ var equationImage = 'Some text with an <img src="/equation_images/image" />';
9
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(equationImage)).to.include('canvas.instructure.com/equation_images/image');
10
+ });
11
+ it('adds vertical-align style to equation images', function () {
12
+ var equationImage = '<img src="/equation_images/abc" />';
13
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(equationImage)).to.include('vertical-align: middle');
14
+ });
15
+ it('leaves non-equation image src untouched', function () {
16
+ var otherImage = '<img src="/another_image">';
17
+ var out = (0, _sanitize.sanitizeHtml)(otherImage);
18
+ (0, _chai.expect)(out).to.include('src="/another_image"');
19
+ (0, _chai.expect)(out).to.not.include('canvas.instructure.com');
20
+ });
9
21
  });
10
- it('replaces equation images', function () {
11
- var equationImage = 'Some text with an <img src="/equation_images/image" />';
12
- (0, _chai.expect)((0, _sanitize.sanitizeHtml)(equationImage)).to.include('canvas.instructure.com/equation_images/image');
22
+ describe('null / empty input handling', function () {
23
+ it('returns empty string for null', function () {
24
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(null)).to.equal('');
25
+ });
26
+ it('returns empty string for undefined', function () {
27
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(void 0)).to.equal('');
28
+ });
29
+ it('returns empty string for empty string', function () {
30
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)('')).to.equal('');
31
+ });
13
32
  });
14
- it('leaves other images alone', function () {
15
- var otherImage = 'Some text with <img src="/another_image" />';
16
- (0, _chai.expect)((0, _sanitize.sanitizeHtml)(otherImage)).to.eq(otherImage);
33
+ describe('XSS - script execution vectors', function () {
34
+ it('strips <script> tags', function () {
35
+ var xss = 'Hello<script>alert(1)</script>World';
36
+ var out = (0, _sanitize.sanitizeHtml)(xss);
37
+ (0, _chai.expect)(out).to.not.include('<script');
38
+ (0, _chai.expect)(out).to.not.include('alert(1)');
39
+ });
40
+ it('strips inline event handlers (onerror)', function () {
41
+ var xss = '<img src="x" onerror="alert(1)">';
42
+ var out = (0, _sanitize.sanitizeHtml)(xss);
43
+ (0, _chai.expect)(out).to.not.match(/onerror/i);
44
+ (0, _chai.expect)(out).to.not.include('alert(1)');
45
+ });
46
+ it('strips inline event handlers (onclick)', function () {
47
+ var xss = '<a href="#" onclick="alert(1)">click</a>';
48
+ var out = (0, _sanitize.sanitizeHtml)(xss);
49
+ (0, _chai.expect)(out).to.not.match(/onclick/i);
50
+ });
51
+ it('strips inline event handlers (onload on svg)', function () {
52
+ var xss = '<svg onload="alert(1)"></svg>';
53
+ var out = (0, _sanitize.sanitizeHtml)(xss);
54
+ (0, _chai.expect)(out).to.not.match(/onload/i);
55
+ (0, _chai.expect)(out).to.not.include('alert(1)');
56
+ });
57
+ it('strips javascript: URLs in href', function () {
58
+ // eslint-disable-next-line no-script-url
59
+ var xss = '<a href="javascript:alert(1)">x</a>';
60
+ var out = (0, _sanitize.sanitizeHtml)(xss);
61
+ (0, _chai.expect)(out).to.not.match(/javascript:/i);
62
+ });
63
+ it('strips javascript: URLs in img src', function () {
64
+ // eslint-disable-next-line no-script-url
65
+ var xss = '<img src="javascript:alert(1)">';
66
+ var out = (0, _sanitize.sanitizeHtml)(xss);
67
+ (0, _chai.expect)(out).to.not.match(/javascript:/i);
68
+ });
69
+ it('strips data: URLs that contain HTML/JS in iframe src', function () {
70
+ var xss = '<iframe src="data:text/html,<script>alert(1)</script>"></iframe>';
71
+ var out = (0, _sanitize.sanitizeHtml)(xss);
72
+ (0, _chai.expect)(out).to.not.include('alert(1)');
73
+ });
74
+ it('strips <object> tags', function () {
75
+ var xss = '<object data="evil.swf"></object>';
76
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<object');
77
+ });
78
+ it('strips <embed> tags', function () {
79
+ var xss = '<embed src="evil.swf">';
80
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<embed');
81
+ });
82
+ it('strips <form> tags (CSRF / phishing surface)', function () {
83
+ var xss = '<form action="https://evil.com"><input name=x></form>';
84
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<form');
85
+ });
86
+ it('strips style tags (CSS-based exfil / clickjacking)', function () {
87
+ var xss = '<style>body{background:url(//evil.com/?c=)}</style>';
88
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<style');
89
+ });
90
+ it('strips <meta http-equiv refresh> redirects', function () {
91
+ var xss = '<meta http-equiv="refresh" content="0;url=https://evil.com">';
92
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<meta');
93
+ });
94
+ it('strips <base> tag (can rewrite all relative URLs)', function () {
95
+ var xss = '<base href="https://evil.com/">';
96
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<base');
97
+ });
98
+ it('strips encoded onerror payloads', function () {
99
+ var xss = '<img src=x onerror=&#97;&#108;&#101;&#114;&#116;(1)>';
100
+ var out = (0, _sanitize.sanitizeHtml)(xss);
101
+ (0, _chai.expect)(out).to.not.match(/onerror/i);
102
+ });
103
+ it('strips mixed-case obfuscated script tags', function () {
104
+ var xss = '<ScRiPt>alert(1)</sCrIpT>';
105
+ var out = (0, _sanitize.sanitizeHtml)(xss);
106
+ (0, _chai.expect)(out).to.not.match(/<script/i);
107
+ (0, _chai.expect)(out).to.not.include('alert(1)');
108
+ });
109
+ });
110
+ describe('benign HTML (should be preserved)', function () {
111
+ it('preserves basic formatting tags', function () {
112
+ var html = '<p>Hello <strong>world</strong> <em>!</em></p>';
113
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(html)).to.equal(html);
114
+ });
115
+ it('preserves links with safe http(s) hrefs', function () {
116
+ var html = '<a href="https://example.com">link</a>';
117
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(html)).to.include('href="https://example.com"');
118
+ });
119
+ it('preserves lists', function () {
120
+ var html = '<ul><li>a</li><li>b</li></ul>';
121
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(html)).to.equal(html);
122
+ });
123
+ it('preserves Canvas RCE iframes (Studio / media embeds)', function () {
124
+ var html = '<iframe src="https://canvas.instructure.com/media_objects_iframe/123" ' + 'allowfullscreen="" allow="fullscreen" frameborder="0" ' + 'data-media-id="123" data-media-type="video"></iframe>';
125
+ var out = (0, _sanitize.sanitizeHtml)(html);
126
+ (0, _chai.expect)(out).to.include('<iframe');
127
+ (0, _chai.expect)(out).to.include('data-media-id="123"');
128
+ (0, _chai.expect)(out).to.include('data-media-type="video"');
129
+ (0, _chai.expect)(out).to.include('allowfullscreen');
130
+ });
131
+ });
132
+ describe('link hardening', function () {
133
+ it('adds rel="noopener noreferrer" to target=_blank links', function () {
134
+ var html = '<a href="https://example.com" target="_blank">x</a>';
135
+ var out = (0, _sanitize.sanitizeHtml)(html);
136
+ (0, _chai.expect)(out).to.match(/rel=["'][^"']*noopener[^"']*["']/);
137
+ (0, _chai.expect)(out).to.match(/rel=["'][^"']*noreferrer[^"']*["']/);
138
+ });
17
139
  });
18
140
  });
@@ -5,32 +5,28 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.sanitizeHtml = sanitizeHtml;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _sanitizeHtml = _interopRequireDefault(require("sanitize-html"));
10
- function transformEquationImage(tagName, attribs) {
11
- return {
12
- tagName: tagName,
13
- attribs: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, attribs), {}, {
14
- src: "https://canvas.instructure.com".concat(attribs.src),
15
- style: 'vertical-align: middle'
16
- })
17
- };
18
- }
19
- function transformImage(tagName, attribs) {
20
- if (attribs.src != null && attribs.src.indexOf('/equation_images') === 0) {
21
- return transformEquationImage(tagName, attribs);
8
+ var _dompurify = _interopRequireDefault(require("dompurify"));
9
+ var CONFIG = {
10
+ ADD_TAGS: ['iframe'],
11
+ ADD_ATTR: ['allowfullscreen', 'allow', 'frameborder', 'sandbox', 'target', 'data-media-id', 'data-media-type'],
12
+ FORBID_TAGS: ['form', 'input', 'button', 'textarea', 'select', 'option']
13
+ };
14
+
15
+ // Rewrite Canvas equation-image relative URLs to absolute,
16
+ // preserving the previous behavior of this module.
17
+ _dompurify.default.addHook('afterSanitizeAttributes', function (node) {
18
+ if (node.tagName === 'IMG') {
19
+ var src = node.getAttribute('src') || '';
20
+ if (src.indexOf('/equation_images') === 0) {
21
+ node.setAttribute('src', "https://canvas.instructure.com".concat(src));
22
+ node.setAttribute('style', 'vertical-align: middle');
23
+ }
24
+ }
25
+ // Harden links opened in a new tab against tab-nabbing.
26
+ if (node.tagName === 'A' && node.getAttribute('target') === '_blank') {
27
+ node.setAttribute('rel', 'noopener noreferrer');
22
28
  }
23
- return {
24
- tagName: tagName,
25
- attribs: attribs
26
- };
27
- }
29
+ });
28
30
  function sanitizeHtml(html) {
29
- return (0, _sanitizeHtml.default)(html, {
30
- allowedTags: false,
31
- allowedAttributes: false,
32
- transformTags: {
33
- img: transformImage
34
- }
35
- });
31
+ return _dompurify.default.sanitize(html == null ? '' : html, CONFIG);
36
32
  }
@@ -26,10 +26,13 @@ describe('OutcomeCheckbox', function () {
26
26
  }, props);
27
27
  }
28
28
  it('renders a checkbox', function () {
29
- var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_index.default, makeProps()), {
29
+ var props = makeProps();
30
+ var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_index.default, props), {
30
31
  disableLifecycleMethods: true
31
32
  });
32
- (0, _chai.expect)(wrapper.find(_uiCheckbox.Checkbox)).to.have.length(1);
33
+ var checkbox = wrapper.find(_uiCheckbox.Checkbox);
34
+ (0, _chai.expect)(checkbox).to.have.length(1);
35
+ (0, _chai.expect)(checkbox.prop('id')).to.equal("outcome-select-".concat(props.outcome.id));
33
36
  });
34
37
  it('renders outcome title in link', function () {
35
38
  var props = makeProps();
@@ -55,6 +55,7 @@ var OutcomeCheckbox = exports.default = (_dec = (0, _emotion.withStyle)(_styles.
55
55
  css: this.props.styles.checkbox,
56
56
  className: "OutcomeSelector"
57
57
  }, (0, _emotion.jsx)(_uiCheckbox.Checkbox, {
58
+ id: "outcome-select-".concat(id),
58
59
  value: id,
59
60
  checked: this.selected(),
60
61
  onChange: function onChange() {
@@ -71,6 +71,7 @@ describe('OutcomeSelectionList', function () {
71
71
  });
72
72
  // Enzyme finds extra Checkbox components because of the instui decorator on the component
73
73
  (0, _chai.expect)(wrapper.find('Checkbox[value="selectAll"]')).to.have.length(3);
74
+ (0, _chai.expect)(wrapper.find('Checkbox[value="selectAll"]').at(0).prop('id')).to.equal('outcome-select-all');
74
75
  });
75
76
  it('renders select all as unchecked when no outcomes selected', function () {
76
77
  var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_index.default, makeProps()), {
@@ -84,6 +84,7 @@ var OutcomeSelectionList = exports.default = (_dec = (0, _emotion.withStyle)(_st
84
84
  }, (0, _emotion.jsx)("div", {
85
85
  css: this.props.styles.checkbox
86
86
  }, (0, _emotion.jsx)(_uiCheckbox.Checkbox, {
87
+ id: "outcome-select-all",
87
88
  value: "selectAll",
88
89
  checked: this.allSelected(),
89
90
  onChange: function onChange() {
@@ -2,17 +2,139 @@
2
2
 
3
3
  var _chai = require("chai");
4
4
  var _sanitize = require("../sanitize.js");
5
- describe('sanitizeForHtml', function () {
6
- it('cleans invalid tags', function () {
7
- var invalid = '<monkey>tag isn\'t closed';
8
- (0, _chai.expect)((0, _sanitize.sanitizeHtml)(invalid)).to.include('</monkey>');
5
+ describe('sanitizeHtml', function () {
6
+ describe('equation images (Canvas-specific)', function () {
7
+ it('rewrites /equation_images src to absolute canvas URL', function () {
8
+ var equationImage = 'Some text with an <img src="/equation_images/image" />';
9
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(equationImage)).to.include('canvas.instructure.com/equation_images/image');
10
+ });
11
+ it('adds vertical-align style to equation images', function () {
12
+ var equationImage = '<img src="/equation_images/abc" />';
13
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(equationImage)).to.include('vertical-align: middle');
14
+ });
15
+ it('leaves non-equation image src untouched', function () {
16
+ var otherImage = '<img src="/another_image">';
17
+ var out = (0, _sanitize.sanitizeHtml)(otherImage);
18
+ (0, _chai.expect)(out).to.include('src="/another_image"');
19
+ (0, _chai.expect)(out).to.not.include('canvas.instructure.com');
20
+ });
9
21
  });
10
- it('replaces equation images', function () {
11
- var equationImage = 'Some text with an <img src="/equation_images/image" />';
12
- (0, _chai.expect)((0, _sanitize.sanitizeHtml)(equationImage)).to.include('canvas.instructure.com/equation_images/image');
22
+ describe('null / empty input handling', function () {
23
+ it('returns empty string for null', function () {
24
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(null)).to.equal('');
25
+ });
26
+ it('returns empty string for undefined', function () {
27
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(void 0)).to.equal('');
28
+ });
29
+ it('returns empty string for empty string', function () {
30
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)('')).to.equal('');
31
+ });
13
32
  });
14
- it('leaves other images alone', function () {
15
- var otherImage = 'Some text with <img src="/another_image" />';
16
- (0, _chai.expect)((0, _sanitize.sanitizeHtml)(otherImage)).to.eq(otherImage);
33
+ describe('XSS - script execution vectors', function () {
34
+ it('strips <script> tags', function () {
35
+ var xss = 'Hello<script>alert(1)</script>World';
36
+ var out = (0, _sanitize.sanitizeHtml)(xss);
37
+ (0, _chai.expect)(out).to.not.include('<script');
38
+ (0, _chai.expect)(out).to.not.include('alert(1)');
39
+ });
40
+ it('strips inline event handlers (onerror)', function () {
41
+ var xss = '<img src="x" onerror="alert(1)">';
42
+ var out = (0, _sanitize.sanitizeHtml)(xss);
43
+ (0, _chai.expect)(out).to.not.match(/onerror/i);
44
+ (0, _chai.expect)(out).to.not.include('alert(1)');
45
+ });
46
+ it('strips inline event handlers (onclick)', function () {
47
+ var xss = '<a href="#" onclick="alert(1)">click</a>';
48
+ var out = (0, _sanitize.sanitizeHtml)(xss);
49
+ (0, _chai.expect)(out).to.not.match(/onclick/i);
50
+ });
51
+ it('strips inline event handlers (onload on svg)', function () {
52
+ var xss = '<svg onload="alert(1)"></svg>';
53
+ var out = (0, _sanitize.sanitizeHtml)(xss);
54
+ (0, _chai.expect)(out).to.not.match(/onload/i);
55
+ (0, _chai.expect)(out).to.not.include('alert(1)');
56
+ });
57
+ it('strips javascript: URLs in href', function () {
58
+ // eslint-disable-next-line no-script-url
59
+ var xss = '<a href="javascript:alert(1)">x</a>';
60
+ var out = (0, _sanitize.sanitizeHtml)(xss);
61
+ (0, _chai.expect)(out).to.not.match(/javascript:/i);
62
+ });
63
+ it('strips javascript: URLs in img src', function () {
64
+ // eslint-disable-next-line no-script-url
65
+ var xss = '<img src="javascript:alert(1)">';
66
+ var out = (0, _sanitize.sanitizeHtml)(xss);
67
+ (0, _chai.expect)(out).to.not.match(/javascript:/i);
68
+ });
69
+ it('strips data: URLs that contain HTML/JS in iframe src', function () {
70
+ var xss = '<iframe src="data:text/html,<script>alert(1)</script>"></iframe>';
71
+ var out = (0, _sanitize.sanitizeHtml)(xss);
72
+ (0, _chai.expect)(out).to.not.include('alert(1)');
73
+ });
74
+ it('strips <object> tags', function () {
75
+ var xss = '<object data="evil.swf"></object>';
76
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<object');
77
+ });
78
+ it('strips <embed> tags', function () {
79
+ var xss = '<embed src="evil.swf">';
80
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<embed');
81
+ });
82
+ it('strips <form> tags (CSRF / phishing surface)', function () {
83
+ var xss = '<form action="https://evil.com"><input name=x></form>';
84
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<form');
85
+ });
86
+ it('strips style tags (CSS-based exfil / clickjacking)', function () {
87
+ var xss = '<style>body{background:url(//evil.com/?c=)}</style>';
88
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<style');
89
+ });
90
+ it('strips <meta http-equiv refresh> redirects', function () {
91
+ var xss = '<meta http-equiv="refresh" content="0;url=https://evil.com">';
92
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<meta');
93
+ });
94
+ it('strips <base> tag (can rewrite all relative URLs)', function () {
95
+ var xss = '<base href="https://evil.com/">';
96
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(xss)).to.not.include('<base');
97
+ });
98
+ it('strips encoded onerror payloads', function () {
99
+ var xss = '<img src=x onerror=&#97;&#108;&#101;&#114;&#116;(1)>';
100
+ var out = (0, _sanitize.sanitizeHtml)(xss);
101
+ (0, _chai.expect)(out).to.not.match(/onerror/i);
102
+ });
103
+ it('strips mixed-case obfuscated script tags', function () {
104
+ var xss = '<ScRiPt>alert(1)</sCrIpT>';
105
+ var out = (0, _sanitize.sanitizeHtml)(xss);
106
+ (0, _chai.expect)(out).to.not.match(/<script/i);
107
+ (0, _chai.expect)(out).to.not.include('alert(1)');
108
+ });
109
+ });
110
+ describe('benign HTML (should be preserved)', function () {
111
+ it('preserves basic formatting tags', function () {
112
+ var html = '<p>Hello <strong>world</strong> <em>!</em></p>';
113
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(html)).to.equal(html);
114
+ });
115
+ it('preserves links with safe http(s) hrefs', function () {
116
+ var html = '<a href="https://example.com">link</a>';
117
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(html)).to.include('href="https://example.com"');
118
+ });
119
+ it('preserves lists', function () {
120
+ var html = '<ul><li>a</li><li>b</li></ul>';
121
+ (0, _chai.expect)((0, _sanitize.sanitizeHtml)(html)).to.equal(html);
122
+ });
123
+ it('preserves Canvas RCE iframes (Studio / media embeds)', function () {
124
+ var html = '<iframe src="https://canvas.instructure.com/media_objects_iframe/123" ' + 'allowfullscreen="" allow="fullscreen" frameborder="0" ' + 'data-media-id="123" data-media-type="video"></iframe>';
125
+ var out = (0, _sanitize.sanitizeHtml)(html);
126
+ (0, _chai.expect)(out).to.include('<iframe');
127
+ (0, _chai.expect)(out).to.include('data-media-id="123"');
128
+ (0, _chai.expect)(out).to.include('data-media-type="video"');
129
+ (0, _chai.expect)(out).to.include('allowfullscreen');
130
+ });
131
+ });
132
+ describe('link hardening', function () {
133
+ it('adds rel="noopener noreferrer" to target=_blank links', function () {
134
+ var html = '<a href="https://example.com" target="_blank">x</a>';
135
+ var out = (0, _sanitize.sanitizeHtml)(html);
136
+ (0, _chai.expect)(out).to.match(/rel=["'][^"']*noopener[^"']*["']/);
137
+ (0, _chai.expect)(out).to.match(/rel=["'][^"']*noreferrer[^"']*["']/);
138
+ });
17
139
  });
18
140
  });
@@ -5,32 +5,28 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.sanitizeHtml = sanitizeHtml;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
- var _sanitizeHtml = _interopRequireDefault(require("sanitize-html"));
10
- function transformEquationImage(tagName, attribs) {
11
- return {
12
- tagName: tagName,
13
- attribs: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, attribs), {}, {
14
- src: "https://canvas.instructure.com".concat(attribs.src),
15
- style: 'vertical-align: middle'
16
- })
17
- };
18
- }
19
- function transformImage(tagName, attribs) {
20
- if (attribs.src != null && attribs.src.indexOf('/equation_images') === 0) {
21
- return transformEquationImage(tagName, attribs);
8
+ var _dompurify = _interopRequireDefault(require("dompurify"));
9
+ var CONFIG = {
10
+ ADD_TAGS: ['iframe'],
11
+ ADD_ATTR: ['allowfullscreen', 'allow', 'frameborder', 'sandbox', 'target', 'data-media-id', 'data-media-type'],
12
+ FORBID_TAGS: ['form', 'input', 'button', 'textarea', 'select', 'option']
13
+ };
14
+
15
+ // Rewrite Canvas equation-image relative URLs to absolute,
16
+ // preserving the previous behavior of this module.
17
+ _dompurify.default.addHook('afterSanitizeAttributes', function (node) {
18
+ if (node.tagName === 'IMG') {
19
+ var src = node.getAttribute('src') || '';
20
+ if (src.indexOf('/equation_images') === 0) {
21
+ node.setAttribute('src', "https://canvas.instructure.com".concat(src));
22
+ node.setAttribute('style', 'vertical-align: middle');
23
+ }
24
+ }
25
+ // Harden links opened in a new tab against tab-nabbing.
26
+ if (node.tagName === 'A' && node.getAttribute('target') === '_blank') {
27
+ node.setAttribute('rel', 'noopener noreferrer');
22
28
  }
23
- return {
24
- tagName: tagName,
25
- attribs: attribs
26
- };
27
- }
29
+ });
28
30
  function sanitizeHtml(html) {
29
- return (0, _sanitizeHtml.default)(html, {
30
- allowedTags: false,
31
- allowedAttributes: false,
32
- transformTags: {
33
- img: transformImage
34
- }
35
- });
31
+ return _dompurify.default.sanitize(html == null ? '' : html, CONFIG);
36
32
  }
@@ -26,10 +26,13 @@ describe('OutcomeCheckbox', function () {
26
26
  }, props);
27
27
  }
28
28
  it('renders a checkbox', function () {
29
- var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_index.default, makeProps()), {
29
+ var props = makeProps();
30
+ var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_index.default, props), {
30
31
  disableLifecycleMethods: true
31
32
  });
32
- (0, _chai.expect)(wrapper.find(_uiCheckbox.Checkbox)).to.have.length(1);
33
+ var checkbox = wrapper.find(_uiCheckbox.Checkbox);
34
+ (0, _chai.expect)(checkbox).to.have.length(1);
35
+ (0, _chai.expect)(checkbox.prop('id')).to.equal("outcome-select-".concat(props.outcome.id));
33
36
  });
34
37
  it('renders outcome title in link', function () {
35
38
  var props = makeProps();
@@ -55,6 +55,7 @@ var OutcomeCheckbox = exports.default = (_dec = (0, _emotion.withStyle)(_styles.
55
55
  css: this.props.styles.checkbox,
56
56
  className: "OutcomeSelector"
57
57
  }, (0, _emotion.jsx)(_uiCheckbox.Checkbox, {
58
+ id: "outcome-select-".concat(id),
58
59
  value: id,
59
60
  checked: this.selected(),
60
61
  onChange: function onChange() {
@@ -71,6 +71,7 @@ describe('OutcomeSelectionList', function () {
71
71
  });
72
72
  // Enzyme finds extra Checkbox components because of the instui decorator on the component
73
73
  (0, _chai.expect)(wrapper.find('Checkbox[value="selectAll"]')).to.have.length(3);
74
+ (0, _chai.expect)(wrapper.find('Checkbox[value="selectAll"]').at(0).prop('id')).to.equal('outcome-select-all');
74
75
  });
75
76
  it('renders select all as unchecked when no outcomes selected', function () {
76
77
  var wrapper = (0, _enzyme.mount)( /*#__PURE__*/_react.default.createElement(_index.default, makeProps()), {
@@ -84,6 +84,7 @@ var OutcomeSelectionList = exports.default = (_dec = (0, _emotion.withStyle)(_st
84
84
  }, (0, _emotion.jsx)("div", {
85
85
  css: this.props.styles.checkbox
86
86
  }, (0, _emotion.jsx)(_uiCheckbox.Checkbox, {
87
+ id: "outcome-select-all",
87
88
  value: "selectAll",
88
89
  checked: this.allSelected(),
89
90
  onChange: function onChange() {