parse5 5.1.0 → 5.1.1
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/LICENSE +19 -0
- package/lib/common/doctype.js +58 -69
- package/lib/serializer/index.js +1 -1
- package/package.json +3 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2013-2019 Ivan Nikulin (ifaaan@gmail.com, https://github.com/inikulin)
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|
package/lib/common/doctype.js
CHANGED
|
@@ -8,72 +8,61 @@ const VALID_SYSTEM_ID = 'about:legacy-compat';
|
|
|
8
8
|
const QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd';
|
|
9
9
|
|
|
10
10
|
const QUIRKS_MODE_PUBLIC_ID_PREFIXES = [
|
|
11
|
-
'+//silmaril//dtd html pro v0r11 19970101//
|
|
12
|
-
'-//
|
|
13
|
-
'-//
|
|
14
|
-
'-//ietf//dtd html 2.0 level 1//
|
|
15
|
-
'-//ietf//dtd html 2.0 level 2//
|
|
16
|
-
'-//ietf//dtd html 2.0 strict level 1//
|
|
17
|
-
'-//ietf//dtd html 2.0 strict level 2//
|
|
18
|
-
'-//ietf//dtd html 2.0 strict//
|
|
19
|
-
'-//ietf//dtd html 2.0//
|
|
20
|
-
'-//ietf//dtd html 2.1e//
|
|
21
|
-
'-//ietf//dtd html 3.0//
|
|
22
|
-
'-//ietf//dtd html 3.
|
|
23
|
-
'-//ietf//dtd html 3.2
|
|
24
|
-
'-//ietf//dtd html 3
|
|
25
|
-
'-//ietf//dtd html
|
|
26
|
-
'-//ietf//dtd html level
|
|
27
|
-
'-//ietf//dtd html level
|
|
28
|
-
'-//ietf//dtd html level
|
|
29
|
-
'-//ietf//dtd html level
|
|
30
|
-
'-//ietf//dtd html level
|
|
31
|
-
'-//ietf//dtd html level 2//
|
|
32
|
-
'-//ietf//dtd html level 3//
|
|
33
|
-
'-//ietf//dtd html
|
|
34
|
-
'-//ietf//dtd html
|
|
35
|
-
'-//
|
|
36
|
-
'-//
|
|
37
|
-
'-//
|
|
38
|
-
'-//
|
|
39
|
-
'-//
|
|
40
|
-
'-//
|
|
41
|
-
'-//
|
|
42
|
-
'-//
|
|
43
|
-
'-//
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'-//
|
|
48
|
-
'-//
|
|
49
|
-
'-//
|
|
50
|
-
'-//
|
|
51
|
-
'-//
|
|
52
|
-
'-//
|
|
53
|
-
'-//
|
|
54
|
-
'-//
|
|
55
|
-
'-//
|
|
56
|
-
'-//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
'-//
|
|
60
|
-
'-//
|
|
61
|
-
'-//
|
|
62
|
-
'-//
|
|
63
|
-
'-//
|
|
64
|
-
'-//
|
|
65
|
-
'-//
|
|
66
|
-
'-//w3c//dtd html 3.2//en',
|
|
67
|
-
'-//w3c//dtd html 3.2s draft//en',
|
|
68
|
-
'-//w3c//dtd html 4.0 frameset//en',
|
|
69
|
-
'-//w3c//dtd html 4.0 transitional//en',
|
|
70
|
-
'-//w3c//dtd html experimental 19960712//en',
|
|
71
|
-
'-//w3c//dtd html experimental 970421//en',
|
|
72
|
-
'-//w3c//dtd w3 html//en',
|
|
73
|
-
'-//w3o//dtd w3 html 3.0//en',
|
|
74
|
-
'-//w3o//dtd w3 html 3.0//en//',
|
|
75
|
-
'-//webtechs//dtd mozilla html 2.0//en',
|
|
76
|
-
'-//webtechs//dtd mozilla html//en'
|
|
11
|
+
'+//silmaril//dtd html pro v0r11 19970101//',
|
|
12
|
+
'-//as//dtd html 3.0 aswedit + extensions//',
|
|
13
|
+
'-//advasoft ltd//dtd html 3.0 aswedit + extensions//',
|
|
14
|
+
'-//ietf//dtd html 2.0 level 1//',
|
|
15
|
+
'-//ietf//dtd html 2.0 level 2//',
|
|
16
|
+
'-//ietf//dtd html 2.0 strict level 1//',
|
|
17
|
+
'-//ietf//dtd html 2.0 strict level 2//',
|
|
18
|
+
'-//ietf//dtd html 2.0 strict//',
|
|
19
|
+
'-//ietf//dtd html 2.0//',
|
|
20
|
+
'-//ietf//dtd html 2.1e//',
|
|
21
|
+
'-//ietf//dtd html 3.0//',
|
|
22
|
+
'-//ietf//dtd html 3.2 final//',
|
|
23
|
+
'-//ietf//dtd html 3.2//',
|
|
24
|
+
'-//ietf//dtd html 3//',
|
|
25
|
+
'-//ietf//dtd html level 0//',
|
|
26
|
+
'-//ietf//dtd html level 1//',
|
|
27
|
+
'-//ietf//dtd html level 2//',
|
|
28
|
+
'-//ietf//dtd html level 3//',
|
|
29
|
+
'-//ietf//dtd html strict level 0//',
|
|
30
|
+
'-//ietf//dtd html strict level 1//',
|
|
31
|
+
'-//ietf//dtd html strict level 2//',
|
|
32
|
+
'-//ietf//dtd html strict level 3//',
|
|
33
|
+
'-//ietf//dtd html strict//',
|
|
34
|
+
'-//ietf//dtd html//',
|
|
35
|
+
'-//metrius//dtd metrius presentational//',
|
|
36
|
+
'-//microsoft//dtd internet explorer 2.0 html strict//',
|
|
37
|
+
'-//microsoft//dtd internet explorer 2.0 html//',
|
|
38
|
+
'-//microsoft//dtd internet explorer 2.0 tables//',
|
|
39
|
+
'-//microsoft//dtd internet explorer 3.0 html strict//',
|
|
40
|
+
'-//microsoft//dtd internet explorer 3.0 html//',
|
|
41
|
+
'-//microsoft//dtd internet explorer 3.0 tables//',
|
|
42
|
+
'-//netscape comm. corp.//dtd html//',
|
|
43
|
+
'-//netscape comm. corp.//dtd strict html//',
|
|
44
|
+
"-//o'reilly and associates//dtd html 2.0//",
|
|
45
|
+
"-//o'reilly and associates//dtd html extended 1.0//",
|
|
46
|
+
"-//o'reilly and associates//dtd html extended relaxed 1.0//",
|
|
47
|
+
'-//sq//dtd html 2.0 hotmetal + extensions//',
|
|
48
|
+
'-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//',
|
|
49
|
+
'-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//',
|
|
50
|
+
'-//spyglass//dtd html 2.0 extended//',
|
|
51
|
+
'-//sun microsystems corp.//dtd hotjava html//',
|
|
52
|
+
'-//sun microsystems corp.//dtd hotjava strict html//',
|
|
53
|
+
'-//w3c//dtd html 3 1995-03-24//',
|
|
54
|
+
'-//w3c//dtd html 3.2 draft//',
|
|
55
|
+
'-//w3c//dtd html 3.2 final//',
|
|
56
|
+
'-//w3c//dtd html 3.2//',
|
|
57
|
+
'-//w3c//dtd html 3.2s draft//',
|
|
58
|
+
'-//w3c//dtd html 4.0 frameset//',
|
|
59
|
+
'-//w3c//dtd html 4.0 transitional//',
|
|
60
|
+
'-//w3c//dtd html experimental 19960712//',
|
|
61
|
+
'-//w3c//dtd html experimental 970421//',
|
|
62
|
+
'-//w3c//dtd w3 html//',
|
|
63
|
+
'-//w3o//dtd w3 html 3.0//',
|
|
64
|
+
'-//webtechs//dtd mozilla html 2.0//',
|
|
65
|
+
'-//webtechs//dtd mozilla html//'
|
|
77
66
|
];
|
|
78
67
|
|
|
79
68
|
const QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat([
|
|
@@ -82,11 +71,11 @@ const QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIX
|
|
|
82
71
|
]);
|
|
83
72
|
|
|
84
73
|
const QUIRKS_MODE_PUBLIC_IDS = ['-//w3o//dtd w3 html strict 3.0//en//', '-/w3c/dtd html 4.0 transitional/en', 'html'];
|
|
85
|
-
const LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ['-//
|
|
74
|
+
const LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ['-//w3c//dtd xhtml 1.0 frameset//', '-//w3c//dtd xhtml 1.0 transitional//'];
|
|
86
75
|
|
|
87
76
|
const LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat([
|
|
88
|
-
'-//
|
|
89
|
-
'-//
|
|
77
|
+
'-//w3c//dtd html 4.01 frameset//',
|
|
78
|
+
'-//w3c//dtd html 4.01 transitional//'
|
|
90
79
|
]);
|
|
91
80
|
|
|
92
81
|
//Utils
|
package/lib/serializer/index.js
CHANGED
|
@@ -117,7 +117,7 @@ class Serializer {
|
|
|
117
117
|
} else if (attr.namespace === NS.XLINK) {
|
|
118
118
|
this.html += 'xlink:' + attr.name;
|
|
119
119
|
} else {
|
|
120
|
-
this.html += attr.
|
|
120
|
+
this.html += attr.prefix + ':' + attr.name;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
this.html += '="' + value + '"';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse5",
|
|
3
3
|
"description": "HTML parser and serializer.",
|
|
4
|
-
"version": "5.1.
|
|
4
|
+
"version": "5.1.1",
|
|
5
5
|
"author": "Ivan Nikulin <ifaaan@gmail.com> (https://github.com/inikulin)",
|
|
6
6
|
"contributors": "https://github.com/inikulin/parse5/graphs/contributors",
|
|
7
7
|
"homepage": "https://github.com/inikulin/parse5",
|
|
@@ -30,5 +30,6 @@
|
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"lib"
|
|
33
|
-
]
|
|
33
|
+
],
|
|
34
|
+
"gitHead": "9c7556ed05e4ff4d884ab2447e27ce3817c42e79"
|
|
34
35
|
}
|