Fix issue when <html> doesn't have any attribs

Close #6
This commit is contained in:
Maxime Thirouin
2014-10-14 07:29:59 +02:00
parent 743196fe7e
commit fa72f25fd5

View File

@@ -348,7 +348,7 @@
, htmlRegex = /<html[^>]+>/gi , htmlRegex = /<html[^>]+>/gi
, htmlAttribsRegex = /\s?[a-z:]+(?:\=(?:\'|\")[^\'\">]+(?:\'|\"))*/gi , htmlAttribsRegex = /\s?[a-z:]+(?:\=(?:\'|\")[^\'\">]+(?:\'|\"))*/gi
, matches = html.match(htmlRegex) , matches = html.match(htmlRegex)
if (matches.length) { if (matches && matches.length) {
matches = matches[0].match(htmlAttribsRegex) matches = matches[0].match(htmlAttribsRegex)
if (matches.length) { if (matches.length) {
matches.shift() matches.shift()