From 6816a0205e329a2564d0a198cf89285064e3bc24 Mon Sep 17 00:00:00 2001
From: Benjamin Tan <demoneaux@gmail.com>
Date: Mon, 22 Jan 2018 17:17:08 +0800
Subject: [PATCH] Allow `data-background` images to load even if there is
 whitespace at the end.

Fixes #2032.
---
 js/reveal.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/reveal.js b/js/reveal.js
index e9445727..7f12d10c 100644
--- a/js/reveal.js
+++ b/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 {
-- 
GitLab