parse5 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +3 -1
- package/README.md +6 -6
- package/lib/{common → tree_construction}/doctype.js +0 -0
- package/lib/tree_construction/parser.js +1 -1
- package/package.json +41 -41
- package/.editorconfig +0 -12
- package/.travis.yml +0 -3
package/.npmignore
CHANGED
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.org/inikulin/parse5)
|
|
3
|
+
[](https://travis-ci.org/inikulin/parse5)
|
|
4
4
|
|
|
5
5
|
Fast full-featured HTML parsing/serialization toolset for Node. Based on WHATWG HTML5 specification.
|
|
6
6
|
To build [TestCafé](http://testcafe.devexpress.com/) we needed fast and ready for production HTML parser, which will parse HTML as a modern browser's parser.
|
|
7
7
|
Existing solutions were either too slow or their output was too inaccurate. So, this is how parse5 was born.
|
|
8
8
|
|
|
9
9
|
**Included tools:**
|
|
10
|
-
* [Parser](
|
|
11
|
-
* [SimpleApiParser](
|
|
12
|
-
* [TreeSerializer](
|
|
10
|
+
* [Parser](#class-parser) - HTML to DOM-tree parser.
|
|
11
|
+
* [SimpleApiParser](#class-simpleapiparser) - [SAX](http://en.wikipedia.org/wiki/Simple_API_for_XML)-style parser for HTML.
|
|
12
|
+
* [TreeSerializer](#class-treeserializer) - DOM-tree to HTML serializer.
|
|
13
13
|
|
|
14
14
|
##Install
|
|
15
15
|
```
|
|
@@ -17,7 +17,7 @@ $ npm install parse5
|
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
##Usage
|
|
21
21
|
```js
|
|
22
22
|
var Parser = require('parse5').Parser;
|
|
23
23
|
|
|
@@ -150,7 +150,7 @@ var parser = new parse5.SimpleApiParser({
|
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
parser.parse('<body>Yo!</body>');
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
---------------------------------------
|
|
File without changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Tokenizer = require('../tokenization/tokenizer'),
|
|
2
2
|
OpenElementStack = require('./open_element_stack'),
|
|
3
3
|
FormattingElementList = require('./formatting_element_list'),
|
|
4
|
+
Doctype = require('./doctype'),
|
|
4
5
|
DefaultTreeAdapter = require('../tree_adapters/default'),
|
|
5
|
-
Doctype = require('../common/doctype'),
|
|
6
6
|
ForeignContent = require('../common/foreign_content'),
|
|
7
7
|
UNICODE = require('../common/unicode'),
|
|
8
8
|
HTML = require('../common/html');
|
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"main": "./index.js",
|
|
37
|
-
"repository": {
|
|
38
|
-
"type": "git",
|
|
39
|
-
"url": "git://github.com/inikulin/parse5.git"
|
|
40
|
-
},
|
|
41
|
-
"scripts": {
|
|
42
|
-
"test": "node test/run_tests.js"
|
|
2
|
+
"name": "parse5",
|
|
3
|
+
"description": "Fast full-featured HTML parsing/serialization toolset for Node. Based on WHATWG HTML5 specification. ",
|
|
4
|
+
"version": "1.1.3",
|
|
5
|
+
"author": "Ivan Nikulin <ifaaan@gmail.com> (https://github.com/inikulin)",
|
|
6
|
+
"contributors": [
|
|
7
|
+
"Sebastian Mayr <sebmaster16@gmail.com> (http://blog.smayr.name)",
|
|
8
|
+
"Sean Lang <slang800@gmail.com> (http://slang.cx)"
|
|
9
|
+
],
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"nodeunit": "0.8.0"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"html",
|
|
15
|
+
"parser",
|
|
16
|
+
"html5",
|
|
17
|
+
"WHATWG",
|
|
18
|
+
"specification",
|
|
19
|
+
"fast",
|
|
20
|
+
"html parser",
|
|
21
|
+
"html5 parser",
|
|
22
|
+
"htmlparser",
|
|
23
|
+
"parse5",
|
|
24
|
+
"serializer",
|
|
25
|
+
"html serializer",
|
|
26
|
+
"htmlserializer",
|
|
27
|
+
"sax",
|
|
28
|
+
"simple api"
|
|
29
|
+
],
|
|
30
|
+
"licenses": [
|
|
31
|
+
{
|
|
32
|
+
"type": "MIT",
|
|
33
|
+
"url": "https://raw.github.com/inikulin/parse5/master/LICENSE"
|
|
43
34
|
}
|
|
35
|
+
],
|
|
36
|
+
"main": "./index.js",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git://github.com/inikulin/parse5.git"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"test": "node test/run_tests.js"
|
|
43
|
+
}
|
|
44
44
|
}
|
package/.editorconfig
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# This file is for unifying the coding style for different editors and IDEs
|
|
2
|
-
# editorconfig.org
|
|
3
|
-
|
|
4
|
-
root = true
|
|
5
|
-
|
|
6
|
-
[*]
|
|
7
|
-
end_of_line = lf
|
|
8
|
-
charset = utf-8
|
|
9
|
-
insert_final_newline = true
|
|
10
|
-
trim_trailing_whitespace = true
|
|
11
|
-
indent_style = space
|
|
12
|
-
indent_size = 4
|
package/.travis.yml
DELETED