Pārlūkot izejas kodu

Allow `data-background` images to load even if there is whitespace at the end.

Fixes #2032.
Benjamin Tan 6 gadi atpakaļ
vecāks
revīzija
6816a0205e
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      js/reveal.js

+ 1 - 1
js/reveal.js

@@ -916,7 +916,7 @@
 
 		if( data.background ) {
 			// 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 );
 			}
 			else {