Permalink
Browse files

Tweaked the HTMLParser to work on the test page.

  • Loading branch information...
1 parent f2bded1 commit 2b621ad28de9b11283a2e5f2b07843eaa5ced758 John Resig committed Jun 18, 2008
Showing with 4 additions and 3 deletions.
  1. +3 −3 src/htmlparser.js
  2. +1 −0 test/debug.js
View
6 src/htmlparser.js
@@ -26,9 +26,9 @@
(function(){
// Regular Expressions for parsing tags and attributes
- var startTag = /^<(\w+)((?:\s+\w+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
- endTag = /^<\/(\w+)[^>]*>/,
- attr = /(\w+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
+ var startTag = /^<([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,
+ endTag = /^<\/([\w:-]+)[^>]*>/,
+ attr = /([\w:-]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
// Empty Elements - HTML 4.01
var empty = makeMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed");
View
1 test/debug.js
@@ -1,5 +1,6 @@
// Init
load("src/env.js");
+load("src/htmlparser.js");
window.location = "test/index.html";

0 comments on commit 2b621ad

Please sign in to comment.