h5p-svg-sanitizer
Background
Usage
const h5pEditor = new H5PEditor(
cache,
{
...
// We've added svg to the whitelist!
contentWhitelist: 'svg json png jpg jpeg gif bmp tif tiff eot ttf woff woff2 otf webm mp4 ogg mp3 m4a wav txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile vtt webvtt gltf glb',
...
},
libraryStorage,
contentStorage,
temporaryStorage,
translationCallback,
urlGenerator,
{
// Add the sanitizer
fileSanitizers: [new SvgSanitizer()]
});Example
Caveats
Testing whether SVGs are correctly sanitized
Last updated
Was this helpful?