parse5 2.2.3 → 3.0.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.
Files changed (33) hide show
  1. package/LICENSE +19 -19
  2. package/README.md +40 -40
  3. package/lib/common/doctype.js +156 -137
  4. package/lib/common/foreign_content.js +1 -1
  5. package/lib/common/html.js +272 -266
  6. package/lib/common/unicode.js +47 -47
  7. package/lib/extensions/location_info/open_element_stack_mixin.js +34 -0
  8. package/lib/extensions/location_info/parser_mixin.js +213 -0
  9. package/lib/extensions/location_info/tokenizer_mixin.js +117 -0
  10. package/lib/extensions/position_tracking/preprocessor_mixin.js +72 -0
  11. package/lib/index.d.ts +1077 -0
  12. package/lib/index.js +44 -108
  13. package/lib/parser/formatting_element_list.js +167 -167
  14. package/lib/parser/index.js +2819 -2817
  15. package/lib/parser/open_element_stack.js +395 -395
  16. package/lib/parser/parser_stream.js +76 -0
  17. package/lib/parser/plain_text_conversion_stream.js +20 -0
  18. package/lib/sax/dev_null_stream.js +14 -14
  19. package/lib/sax/index.js +7 -119
  20. package/lib/serializer/index.js +162 -180
  21. package/lib/serializer/{stream.js → serializer_stream.js} +28 -49
  22. package/lib/tokenizer/index.js +65 -22
  23. package/lib/tokenizer/named_entity_data.js +5 -0
  24. package/lib/tokenizer/preprocessor.js +0 -8
  25. package/lib/tree_adapters/default.js +209 -578
  26. package/lib/tree_adapters/htmlparser2.js +338 -327
  27. package/lib/{common → utils}/merge_options.js +13 -13
  28. package/lib/utils/mixin.js +18 -0
  29. package/package.json +13 -14
  30. package/lib/location_info/parser_mixin.js +0 -217
  31. package/lib/location_info/tokenizer_mixin.js +0 -169
  32. package/lib/parser/stream.js +0 -140
  33. package/lib/tokenizer/named_entity_trie.js +0 -6
package/LICENSE CHANGED
@@ -1,19 +1,19 @@
1
- Copyright (c) 2013-2016 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.
1
+ Copyright (c) 2013-2016 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/README.md CHANGED
@@ -1,40 +1,40 @@
1
- <p align="center">
2
- <a href="https://github.com/inikulin/parse5">
3
- <img src="https://raw.github.com/inikulin/parse5/master/docs/logo.png" alt="parse5" />
4
- </a>
5
- </p>
6
-
7
- <p align="center">
8
- <i>WHATWG HTML5 specification-compliant, fast and ready for production HTML parsing/serialization toolset for Node.js</i>
9
- </p>
10
-
11
- <p align="center">
12
- <a href="https://travis-ci.org/inikulin/parse5"><img alt="Build Status" src="https://api.travis-ci.org/inikulin/parse5.svg"></a>
13
- <a href="https://www.npmjs.com/package/parse5"><img alt="NPM Version" src="https://img.shields.io/npm/v/parse5.svg"></a>
14
- <a href="https://npmjs.org/package/parse5"><img alt="Downloads" src="http://img.shields.io/npm/dm/parse5.svg"></a>
15
- <a href="https://npmjs.org/package/parse5"><img alt="Downloads total" src="http://img.shields.io/npm/dt/parse5.svg"></a>
16
- </p>
17
-
18
- <p align="center">
19
- <b><i>parse5</i></b> provides nearly everything you may need when dealing with HTML. It's the fastest spec-compliant HTML parser
20
- for Node to date. It parses HTML the way the latest version of your browser does. It has proven itself reliable in such projects
21
- as <a href="https://github.com/tmpvar/jsdom">jsdom</a>, <a href="https://github.com/angular/angular">Angular2</a>, <a href="https://www.polymer-project.org">Polymer</a> and many more.
22
- </p>
23
-
24
- ----
25
-
26
- <p align="center">
27
- <a href="https://github.com/inikulin/parse5/wiki/Documentation">Documentation</a>
28
- </p>
29
-
30
- <p align="center">
31
- <a href="https://github.com/inikulin/parse5/wiki/Documentation#version-history">Version history</a>
32
- </p>
33
-
34
- <p align="center">
35
- <a href="http://astexplorer.net/#/1CHlCXc4n4">Online playground</a>
36
- </p>
37
-
38
- <p align="center">
39
- <a href="https://github.com/inikulin/parse5/issues">Issue tracker</a>
40
- </p>
1
+ <p align="center">
2
+ <a href="https://github.com/inikulin/parse5">
3
+ <img src="https://raw.github.com/inikulin/parse5/master/media/logo.png" alt="parse5" />
4
+ </a>
5
+ </p>
6
+
7
+ <p align="center">
8
+ <i>HTML parsing/serialization toolset for Node.js. <a href="https://html.spec.whatwg.org/multipage/">WHATWG HTML Living Standard (aka HTML5)</a>-compliant.</i>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://travis-ci.org/inikulin/parse5"><img alt="Build Status" src="https://api.travis-ci.org/inikulin/parse5.svg"></a>
13
+ <a href="https://www.npmjs.com/package/parse5"><img alt="NPM Version" src="https://img.shields.io/npm/v/parse5.svg"></a>
14
+ <a href="https://npmjs.org/package/parse5"><img alt="Downloads" src="http://img.shields.io/npm/dm/parse5.svg"></a>
15
+ <a href="https://npmjs.org/package/parse5"><img alt="Downloads total" src="http://img.shields.io/npm/dt/parse5.svg"></a>
16
+ </p>
17
+
18
+ <p align="center">
19
+ <b><i>parse5</i></b> provides nearly everything you may need when dealing with HTML. It's the fastest spec-compliant HTML parser
20
+ for Node to date. It parses HTML the way the latest version of your browser does. It has proven itself reliable in such projects
21
+ as <a href="https://github.com/tmpvar/jsdom">jsdom</a>, <a href="https://github.com/angular/angular">Angular2</a>, <a href="https://www.polymer-project.org">Polymer</a> and many more.
22
+ </p>
23
+
24
+ ----
25
+
26
+ <p align="center">
27
+ <a href="http://inikulin.github.io/parse5">Documentation</a>
28
+ </p>
29
+
30
+ <p align="center">
31
+ <a href="http://inikulin.github.io/parse5#version-history">Version history</a>
32
+ </p>
33
+
34
+ <p align="center">
35
+ <a href="http://astexplorer.net/#/1CHlCXc4n4">Online playground</a>
36
+ </p>
37
+
38
+ <p align="center">
39
+ <a href="https://github.com/inikulin/parse5/issues">Issue tracker</a>
40
+ </p>
@@ -1,137 +1,156 @@
1
- 'use strict';
2
-
3
- //Const
4
- var VALID_DOCTYPE_NAME = 'html',
5
- QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd',
6
- QUIRKS_MODE_PUBLIC_ID_PREFIXES = [
7
- '+//silmaril//dtd html pro v0r11 19970101//en',
8
- '-//advasoft ltd//dtd html 3.0 aswedit + extensions//en',
9
- '-//as//dtd html 3.0 aswedit + extensions//en',
10
- '-//ietf//dtd html 2.0 level 1//en',
11
- '-//ietf//dtd html 2.0 level 2//en',
12
- '-//ietf//dtd html 2.0 strict level 1//en',
13
- '-//ietf//dtd html 2.0 strict level 2//en',
14
- '-//ietf//dtd html 2.0 strict//en',
15
- '-//ietf//dtd html 2.0//en',
16
- '-//ietf//dtd html 2.1e//en',
17
- '-//ietf//dtd html 3.0//en',
18
- '-//ietf//dtd html 3.0//en//',
19
- '-//ietf//dtd html 3.2 final//en',
20
- '-//ietf//dtd html 3.2//en',
21
- '-//ietf//dtd html 3//en',
22
- '-//ietf//dtd html level 0//en',
23
- '-//ietf//dtd html level 0//en//2.0',
24
- '-//ietf//dtd html level 1//en',
25
- '-//ietf//dtd html level 1//en//2.0',
26
- '-//ietf//dtd html level 2//en',
27
- '-//ietf//dtd html level 2//en//2.0',
28
- '-//ietf//dtd html level 3//en',
29
- '-//ietf//dtd html level 3//en//3.0',
30
- '-//ietf//dtd html strict level 0//en',
31
- '-//ietf//dtd html strict level 0//en//2.0',
32
- '-//ietf//dtd html strict level 1//en',
33
- '-//ietf//dtd html strict level 1//en//2.0',
34
- '-//ietf//dtd html strict level 2//en',
35
- '-//ietf//dtd html strict level 2//en//2.0',
36
- '-//ietf//dtd html strict level 3//en',
37
- '-//ietf//dtd html strict level 3//en//3.0',
38
- '-//ietf//dtd html strict//en',
39
- '-//ietf//dtd html strict//en//2.0',
40
- '-//ietf//dtd html strict//en//3.0',
41
- '-//ietf//dtd html//en',
42
- '-//ietf//dtd html//en//2.0',
43
- '-//ietf//dtd html//en//3.0',
44
- '-//metrius//dtd metrius presentational//en',
45
- '-//microsoft//dtd internet explorer 2.0 html strict//en',
46
- '-//microsoft//dtd internet explorer 2.0 html//en',
47
- '-//microsoft//dtd internet explorer 2.0 tables//en',
48
- '-//microsoft//dtd internet explorer 3.0 html strict//en',
49
- '-//microsoft//dtd internet explorer 3.0 html//en',
50
- '-//microsoft//dtd internet explorer 3.0 tables//en',
51
- '-//netscape comm. corp.//dtd html//en',
52
- '-//netscape comm. corp.//dtd strict html//en',
53
- '-//o\'reilly and associates//dtd html 2.0//en',
54
- '-//o\'reilly and associates//dtd html extended 1.0//en',
55
- '-//spyglass//dtd html 2.0 extended//en',
56
- '-//sq//dtd html 2.0 hotmetal + extensions//en',
57
- '-//sun microsystems corp.//dtd hotjava html//en',
58
- '-//sun microsystems corp.//dtd hotjava strict html//en',
59
- '-//w3c//dtd html 3 1995-03-24//en',
60
- '-//w3c//dtd html 3.2 draft//en',
61
- '-//w3c//dtd html 3.2 final//en',
62
- '-//w3c//dtd html 3.2//en',
63
- '-//w3c//dtd html 3.2s draft//en',
64
- '-//w3c//dtd html 4.0 frameset//en',
65
- '-//w3c//dtd html 4.0 transitional//en',
66
- '-//w3c//dtd html experimental 19960712//en',
67
- '-//w3c//dtd html experimental 970421//en',
68
- '-//w3c//dtd w3 html//en',
69
- '-//w3o//dtd w3 html 3.0//en',
70
- '-//w3o//dtd w3 html 3.0//en//',
71
- '-//webtechs//dtd mozilla html 2.0//en',
72
- '-//webtechs//dtd mozilla html//en'
73
- ],
74
- QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = [
75
- '-//w3c//dtd html 4.01 frameset//',
76
- '-//w3c//dtd html 4.01 transitional//'
77
- ],
78
- QUIRKS_MODE_PUBLIC_IDS = [
79
- '-//w3o//dtd w3 html strict 3.0//en//',
80
- '-/w3c/dtd html 4.0 transitional/en',
81
- 'html'
82
- ];
83
-
84
-
85
- //Utils
86
- function enquoteDoctypeId(id) {
87
- var quote = id.indexOf('"') !== -1 ? '\'' : '"';
88
-
89
- return quote + id + quote;
90
- }
91
-
92
-
93
- //API
94
- exports.isQuirks = function (name, publicId, systemId) {
95
- if (name !== VALID_DOCTYPE_NAME)
96
- return true;
97
-
98
- if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID)
99
- return true;
100
-
101
- if (publicId !== null) {
102
- publicId = publicId.toLowerCase();
103
-
104
- if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1)
105
- return true;
106
-
107
- var prefixes = QUIRKS_MODE_PUBLIC_ID_PREFIXES;
108
-
109
- if (systemId === null)
110
- prefixes = prefixes.concat(QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES);
111
-
112
- for (var i = 0; i < prefixes.length; i++) {
113
- if (publicId.indexOf(prefixes[i]) === 0)
114
- return true;
115
- }
116
- }
117
-
118
- return false;
119
- };
120
-
121
- exports.serializeContent = function (name, publicId, systemId) {
122
- var str = '!DOCTYPE ';
123
-
124
- if (name)
125
- str += name;
126
-
127
- if (publicId !== null)
128
- str += ' PUBLIC ' + enquoteDoctypeId(publicId);
129
-
130
- else if (systemId !== null)
131
- str += ' SYSTEM';
132
-
133
- if (systemId !== null)
134
- str += ' ' + enquoteDoctypeId(systemId);
135
-
136
- return str;
137
- };
1
+ 'use strict';
2
+
3
+ var DOCUMENT_MODE = require('./html').DOCUMENT_MODE;
4
+
5
+ //Const
6
+ var VALID_DOCTYPE_NAME = 'html',
7
+ QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd',
8
+ QUIRKS_MODE_PUBLIC_ID_PREFIXES = [
9
+ '+//silmaril//dtd html pro v0r11 19970101//en',
10
+ '-//advasoft ltd//dtd html 3.0 aswedit + extensions//en',
11
+ '-//as//dtd html 3.0 aswedit + extensions//en',
12
+ '-//ietf//dtd html 2.0 level 1//en',
13
+ '-//ietf//dtd html 2.0 level 2//en',
14
+ '-//ietf//dtd html 2.0 strict level 1//en',
15
+ '-//ietf//dtd html 2.0 strict level 2//en',
16
+ '-//ietf//dtd html 2.0 strict//en',
17
+ '-//ietf//dtd html 2.0//en',
18
+ '-//ietf//dtd html 2.1e//en',
19
+ '-//ietf//dtd html 3.0//en',
20
+ '-//ietf//dtd html 3.0//en//',
21
+ '-//ietf//dtd html 3.2 final//en',
22
+ '-//ietf//dtd html 3.2//en',
23
+ '-//ietf//dtd html 3//en',
24
+ '-//ietf//dtd html level 0//en',
25
+ '-//ietf//dtd html level 0//en//2.0',
26
+ '-//ietf//dtd html level 1//en',
27
+ '-//ietf//dtd html level 1//en//2.0',
28
+ '-//ietf//dtd html level 2//en',
29
+ '-//ietf//dtd html level 2//en//2.0',
30
+ '-//ietf//dtd html level 3//en',
31
+ '-//ietf//dtd html level 3//en//3.0',
32
+ '-//ietf//dtd html strict level 0//en',
33
+ '-//ietf//dtd html strict level 0//en//2.0',
34
+ '-//ietf//dtd html strict level 1//en',
35
+ '-//ietf//dtd html strict level 1//en//2.0',
36
+ '-//ietf//dtd html strict level 2//en',
37
+ '-//ietf//dtd html strict level 2//en//2.0',
38
+ '-//ietf//dtd html strict level 3//en',
39
+ '-//ietf//dtd html strict level 3//en//3.0',
40
+ '-//ietf//dtd html strict//en',
41
+ '-//ietf//dtd html strict//en//2.0',
42
+ '-//ietf//dtd html strict//en//3.0',
43
+ '-//ietf//dtd html//en',
44
+ '-//ietf//dtd html//en//2.0',
45
+ '-//ietf//dtd html//en//3.0',
46
+ '-//metrius//dtd metrius presentational//en',
47
+ '-//microsoft//dtd internet explorer 2.0 html strict//en',
48
+ '-//microsoft//dtd internet explorer 2.0 html//en',
49
+ '-//microsoft//dtd internet explorer 2.0 tables//en',
50
+ '-//microsoft//dtd internet explorer 3.0 html strict//en',
51
+ '-//microsoft//dtd internet explorer 3.0 html//en',
52
+ '-//microsoft//dtd internet explorer 3.0 tables//en',
53
+ '-//netscape comm. corp.//dtd html//en',
54
+ '-//netscape comm. corp.//dtd strict html//en',
55
+ '-//o\'reilly and associates//dtd html 2.0//en',
56
+ '-//o\'reilly and associates//dtd html extended 1.0//en',
57
+ '-//spyglass//dtd html 2.0 extended//en',
58
+ '-//sq//dtd html 2.0 hotmetal + extensions//en',
59
+ '-//sun microsystems corp.//dtd hotjava html//en',
60
+ '-//sun microsystems corp.//dtd hotjava strict html//en',
61
+ '-//w3c//dtd html 3 1995-03-24//en',
62
+ '-//w3c//dtd html 3.2 draft//en',
63
+ '-//w3c//dtd html 3.2 final//en',
64
+ '-//w3c//dtd html 3.2//en',
65
+ '-//w3c//dtd html 3.2s draft//en',
66
+ '-//w3c//dtd html 4.0 frameset//en',
67
+ '-//w3c//dtd html 4.0 transitional//en',
68
+ '-//w3c//dtd html experimental 19960712//en',
69
+ '-//w3c//dtd html experimental 970421//en',
70
+ '-//w3c//dtd w3 html//en',
71
+ '-//w3o//dtd w3 html 3.0//en',
72
+ '-//w3o//dtd w3 html 3.0//en//',
73
+ '-//webtechs//dtd mozilla html 2.0//en',
74
+ '-//webtechs//dtd mozilla html//en'
75
+ ],
76
+ QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat([
77
+ '-//w3c//dtd html 4.01 frameset//',
78
+ '-//w3c//dtd html 4.01 transitional//'
79
+ ]),
80
+ QUIRKS_MODE_PUBLIC_IDS = [
81
+ '-//w3o//dtd w3 html strict 3.0//en//',
82
+ '-/w3c/dtd html 4.0 transitional/en',
83
+ 'html'
84
+ ],
85
+ LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = [
86
+ '-//W3C//DTD XHTML 1.0 Frameset//',
87
+ '-//W3C//DTD XHTML 1.0 Transitional//'
88
+ ],
89
+ LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat([
90
+ '-//W3C//DTD HTML 4.01 Frameset//',
91
+ '-//W3C//DTD HTML 4.01 Transitional//'
92
+ ]);
93
+
94
+
95
+ //Utils
96
+ function enquoteDoctypeId(id) {
97
+ var quote = id.indexOf('"') !== -1 ? '\'' : '"';
98
+
99
+ return quote + id + quote;
100
+ }
101
+
102
+ function hasPrefix(publicId, prefixes) {
103
+ for (var i = 0; i < prefixes.length; i++) {
104
+ if (publicId.indexOf(prefixes[i]) === 0)
105
+ return true;
106
+ }
107
+
108
+ return false;
109
+ }
110
+
111
+
112
+ //API
113
+ exports.getDocumentMode = function (name, publicId, systemId) {
114
+ if (name !== VALID_DOCTYPE_NAME)
115
+ return DOCUMENT_MODE.QUIRKS;
116
+
117
+ if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID)
118
+ return DOCUMENT_MODE.QUIRKS;
119
+
120
+ if (publicId !== null) {
121
+ publicId = publicId.toLowerCase();
122
+
123
+ if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1)
124
+ return DOCUMENT_MODE.QUIRKS;
125
+
126
+ var prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES;
127
+
128
+ if (hasPrefix(publicId, prefixes))
129
+ return DOCUMENT_MODE.QUIRKS;
130
+
131
+ prefixes = systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES;
132
+
133
+ if (hasPrefix(publicId, prefixes))
134
+ return DOCUMENT_MODE.LIMITED_QUIRKS;
135
+ }
136
+
137
+ return DOCUMENT_MODE.NO_QUIRKS;
138
+ };
139
+
140
+ exports.serializeContent = function (name, publicId, systemId) {
141
+ var str = '!DOCTYPE ';
142
+
143
+ if (name)
144
+ str += name;
145
+
146
+ if (publicId !== null)
147
+ str += ' PUBLIC ' + enquoteDoctypeId(publicId);
148
+
149
+ else if (systemId !== null)
150
+ str += ' SYSTEM';
151
+
152
+ if (systemId !== null)
153
+ str += ' ' + enquoteDoctypeId(systemId);
154
+
155
+ return str;
156
+ };
@@ -135,7 +135,7 @@ var SVG_TAG_NAMES_ADJUSTMENT_MAP = exports.SVG_TAG_NAMES_ADJUSTMENT_MAP = {
135
135
  };
136
136
 
137
137
  //Tags that causes exit from foreign content
138
- var EXITS_FOREIGN_CONTENT = {};
138
+ var EXITS_FOREIGN_CONTENT = Object.create(null);
139
139
 
140
140
  EXITS_FOREIGN_CONTENT[$.B] = true;
141
141
  EXITS_FOREIGN_CONTENT[$.BIG] = true;