--- markup/html/scripting-parser/parser.html 2008/04/27 08:56:34 1.8 +++ markup/html/scripting-parser/parser.html 2008/04/27 09:16:11 1.9 @@ -150,14 +150,19 @@ tagName = v.toLowerCase (); return ''; }); - e = e.replace (/^\s*([^\s=]+)\s*(?:=\s*(?:"([^"]*)"|'([^']*)'|([^"']+)))?/, - function (x, attrName, attrValue1, attrValue2, attrValue3) { - v = attrValue1 || attrValue2 || attrValue3; - v = v.replace (/"/g, '"').replace (/'/g, "'") - .replace (/&/g, '&'); - attrs[attrName.toLowerCase ()] = v; - return ''; - }); + while (true) { + var m = false; + e = e.replace (/^\s*([^\s=]+)\s*(?:=\s*(?:"([^"]*)"|'([^']*)'|([^"'\s]*)))?/, + function (x, attrName, attrValue1, attrValue2, attrValue3) { + v = attrValue1 || attrValue2 || attrValue3; + v = v.replace (/"/g, '"').replace (/'/g, "'") + .replace (/&/g, '&'); + attrs[attrName.toLowerCase ()] = v; + m = true; + return ''; + }); + if (!m) break; + } if (e.length) { log ('Broken start tag: "' + e + '"'); } @@ -644,7 +649,9 @@ r += '| ' + indent + node.localName + '\n'; if (node.async) r += '| ' + indent + ' async=""\n'; if (node.defer) r += '| ' + indent + ' defer=""\n'; - if (node.src) r += '| ' + indent + ' src="' + node.src + '"\n'; + if (node.src != null) { + r += '| ' + indent + ' src="' + node.src + '"\n'; + } r += dumpTree (node, indent + ' '); } else if (node instanceof JSText) { r += '| ' + indent + '"' + node.data + '"\n'; @@ -732,7 +739,5 @@

For some reason, this parser does not work in browsers that do not support JavaScript 1.5. - - \ No newline at end of file