Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tweaked the HTMLParser to work on the test page.

  • Loading branch information...
commit 2b621ad28de9b11283a2e5f2b07843eaa5ced758 1 parent f2bded1
John Resig authored
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";
Please sign in to comment.
Something went wrong with that request. Please try again.