diff --git a/src/js/theme/navigation.js b/src/js/theme/navigation.js index f1ff54f2..ce0eed6e 100644 --- a/src/js/theme/navigation.js +++ b/src/js/theme/navigation.js @@ -229,7 +229,7 @@ function handleNavigation(relativeUrl, push) { var responseURL = xhr.getResponseHeader('X-Current-Location') || uri; // Replace html content - html = html.replace( /<(\/?)(html|head|body)([^>]*)>/ig, function(a,b,c,d){ + html = html.replace( /<(\/?)(html|head|body)[>\s]([^>]*)>?/ig, function(a,b,c,d){ return '<' + b + 'div' + ( b ? '' : ' data-element="' + c + '"' ) + d + '>'; });