Merge pull request #2078 from bnjmnt4n/data-background

Allow `data-background` images to load even if there is whitespace at…
This commit is contained in:
Hakim El Hattab 2018-01-22 10:53:44 +01:00 committed by GitHub
commit e3205a55be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -916,7 +916,7 @@
if( data.background ) { if( data.background ) {
// Auto-wrap image urls in url(...) // Auto-wrap image urls in url(...)
if( /^(http|file|\/\/)/gi.test( data.background ) || /\.(svg|png|jpg|jpeg|gif|bmp)([?#]|$)/gi.test( data.background ) ) { if( /^(http|file|\/\/)/gi.test( data.background ) || /\.(svg|png|jpg|jpeg|gif|bmp)([?#\s]|$)/gi.test( data.background ) ) {
slide.setAttribute( 'data-background-image', data.background ); slide.setAttribute( 'data-background-image', data.background );
} }
else { else {