fix issue with loading base64 images #2978

This commit is contained in:
hakimel
2021-09-28 13:02:16 +02:00
parent 0da9821e90
commit 05e57dea66
4 changed files with 15 additions and 6 deletions

View File

@ -102,9 +102,16 @@ export default class SlideContent {
// Images
if( backgroundImage ) {
backgroundContent.style.backgroundImage = backgroundImage.split( ',' ).map( background => {
return `url(${encodeURI(background.trim())})`;
}).join( ',' );
// base64
if( /^data:/.test( backgroundImage.trim() ) ) {
backgroundContent.style.backgroundImage = `url(${backgroundImage.trim()})`;
}
// URL(s)
else {
backgroundContent.style.backgroundImage = backgroundImage.split( ',' ).map( background => {
return `url(${encodeURI(background.trim())})`;
}).join( ',' );
}
}
// Videos
else if ( backgroundVideo && !this.Reveal.isSpeakerNotes() ) {