Merge pull request #38 from gatapia/patch-3

Fix demo screenshots.html with head element contains attributes
This commit is contained in:
Niklas von Hertzen 2011-12-07 06:12:56 -08:00
commit 0d24b9a734

View File

@ -252,7 +252,10 @@
});
$('base').attr('href',urlParts.protocol+"//"+urlParts.hostname+"/");
html = html.replace("<head>","<head><base href='"+urlParts.protocol+"//"+urlParts.hostname+"/' />");
var base = "<base href='"+urlParts.protocol+"//"+urlParts.hostname+"/' />";
var headIdx = html.indexOf('<head');
var endHeadIdx = html.indexOf('>', headIdx);
html = html.substring(0, endHeadIdx + 1) + base + html.substring(endHeadIdx + 1);
if ($("#disablejs").prop('checked')){
html = html.replace(/\<script/gi,"<!--<script");
html = html.replace(/\<\/script\>/gi,"<\/script>-->");