cdk-docker-image-deployment 0.0.931 → 0.0.933
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/.jsii +5 -5
- package/API.md +15 -1
- package/lib/destination.js +1 -1
- package/lib/docker-image-deployment.js +1 -1
- package/lib/source.js +1 -1
- package/node_modules/@types/aws-lambda/README.md +1 -1
- package/node_modules/@types/aws-lambda/common/api-gateway.d.ts +2 -0
- package/node_modules/@types/aws-lambda/handler.d.ts +1 -1
- package/node_modules/@types/aws-lambda/package.json +2 -2
- package/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +5 -0
- package/node_modules/aws-sdk/README.md +16 -195
- package/node_modules/aws-sdk/dist/aws-sdk-core-react-native.js +756 -346
- package/node_modules/aws-sdk/dist/aws-sdk-react-native.js +3758 -2938
- package/node_modules/aws-sdk/dist/aws-sdk.js +5 -5
- package/node_modules/aws-sdk/dist/aws-sdk.min.js +5 -5
- package/node_modules/aws-sdk/lib/core.js +1 -1
- package/node_modules/aws-sdk/lib/maintenance_mode_message.js +2 -2
- package/node_modules/aws-sdk/package.json +1 -1
- package/node_modules/which-typed-array/CHANGELOG.md +8 -0
- package/node_modules/which-typed-array/README.md +1 -1
- package/node_modules/which-typed-array/index.d.ts +14 -10
- package/node_modules/which-typed-array/index.js +10 -5
- package/node_modules/which-typed-array/package.json +6 -6
- package/node_modules/xml2js/node_modules/sax/LICENSE.md +55 -0
- package/node_modules/xml2js/node_modules/sax/README.md +42 -43
- package/node_modules/xml2js/node_modules/sax/lib/sax.js +473 -366
- package/node_modules/xml2js/node_modules/sax/package.json +11 -9
- package/package.json +7 -7
- package/node_modules/xml2js/node_modules/sax/LICENSE +0 -41
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
;(function (sax) {
|
|
2
|
-
|
|
1
|
+
;(function (sax) {
|
|
2
|
+
// wrapper for non-node envs
|
|
3
|
+
sax.parser = function (strict, opt) {
|
|
4
|
+
return new SAXParser(strict, opt)
|
|
5
|
+
}
|
|
3
6
|
sax.SAXParser = SAXParser
|
|
4
7
|
sax.SAXStream = SAXStream
|
|
5
8
|
sax.createStream = createStream
|
|
@@ -16,9 +19,18 @@
|
|
|
16
19
|
sax.MAX_BUFFER_LENGTH = 64 * 1024
|
|
17
20
|
|
|
18
21
|
var buffers = [
|
|
19
|
-
'comment',
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
+
'comment',
|
|
23
|
+
'sgmlDecl',
|
|
24
|
+
'textNode',
|
|
25
|
+
'tagName',
|
|
26
|
+
'doctype',
|
|
27
|
+
'procInstName',
|
|
28
|
+
'procInstBody',
|
|
29
|
+
'entity',
|
|
30
|
+
'attribName',
|
|
31
|
+
'attribValue',
|
|
32
|
+
'cdata',
|
|
33
|
+
'script',
|
|
22
34
|
]
|
|
23
35
|
|
|
24
36
|
sax.EVENTS = [
|
|
@@ -39,10 +51,10 @@
|
|
|
39
51
|
'ready',
|
|
40
52
|
'script',
|
|
41
53
|
'opennamespace',
|
|
42
|
-
'closenamespace'
|
|
54
|
+
'closenamespace',
|
|
43
55
|
]
|
|
44
56
|
|
|
45
|
-
function SAXParser
|
|
57
|
+
function SAXParser(strict, opt) {
|
|
46
58
|
if (!(this instanceof SAXParser)) {
|
|
47
59
|
return new SAXParser(strict, opt)
|
|
48
60
|
}
|
|
@@ -61,7 +73,10 @@
|
|
|
61
73
|
parser.noscript = !!(strict || parser.opt.noscript)
|
|
62
74
|
parser.state = S.BEGIN
|
|
63
75
|
parser.strictEntities = parser.opt.strictEntities
|
|
64
|
-
parser.ENTITIES =
|
|
76
|
+
parser.ENTITIES =
|
|
77
|
+
parser.strictEntities ?
|
|
78
|
+
Object.create(sax.XML_ENTITIES)
|
|
79
|
+
: Object.create(sax.ENTITIES)
|
|
65
80
|
parser.attribList = []
|
|
66
81
|
|
|
67
82
|
// namespaces form a prototype chain.
|
|
@@ -74,7 +89,7 @@
|
|
|
74
89
|
// disallow unquoted attribute values if not otherwise configured
|
|
75
90
|
// and strict mode is true
|
|
76
91
|
if (parser.opt.unquotedAttributeValues === undefined) {
|
|
77
|
-
parser.opt.unquotedAttributeValues = !strict
|
|
92
|
+
parser.opt.unquotedAttributeValues = !strict
|
|
78
93
|
}
|
|
79
94
|
|
|
80
95
|
// mostly just for error reporting
|
|
@@ -87,7 +102,7 @@
|
|
|
87
102
|
|
|
88
103
|
if (!Object.create) {
|
|
89
104
|
Object.create = function (o) {
|
|
90
|
-
function F
|
|
105
|
+
function F() {}
|
|
91
106
|
F.prototype = o
|
|
92
107
|
var newf = new F()
|
|
93
108
|
return newf
|
|
@@ -102,7 +117,7 @@
|
|
|
102
117
|
}
|
|
103
118
|
}
|
|
104
119
|
|
|
105
|
-
function checkBufferLength
|
|
120
|
+
function checkBufferLength(parser) {
|
|
106
121
|
var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
|
|
107
122
|
var maxActual = 0
|
|
108
123
|
for (var i = 0, l = buffers.length; i < l; i++) {
|
|
@@ -138,13 +153,13 @@
|
|
|
138
153
|
parser.bufferCheckPosition = m + parser.position
|
|
139
154
|
}
|
|
140
155
|
|
|
141
|
-
function clearBuffers
|
|
156
|
+
function clearBuffers(parser) {
|
|
142
157
|
for (var i = 0, l = buffers.length; i < l; i++) {
|
|
143
158
|
parser[buffers[i]] = ''
|
|
144
159
|
}
|
|
145
160
|
}
|
|
146
161
|
|
|
147
|
-
function flushBuffers
|
|
162
|
+
function flushBuffers(parser) {
|
|
148
163
|
closeText(parser)
|
|
149
164
|
if (parser.cdata !== '') {
|
|
150
165
|
emitNode(parser, 'oncdata', parser.cdata)
|
|
@@ -157,11 +172,20 @@
|
|
|
157
172
|
}
|
|
158
173
|
|
|
159
174
|
SAXParser.prototype = {
|
|
160
|
-
end: function () {
|
|
175
|
+
end: function () {
|
|
176
|
+
end(this)
|
|
177
|
+
},
|
|
161
178
|
write: write,
|
|
162
|
-
resume: function () {
|
|
163
|
-
|
|
164
|
-
|
|
179
|
+
resume: function () {
|
|
180
|
+
this.error = null
|
|
181
|
+
return this
|
|
182
|
+
},
|
|
183
|
+
close: function () {
|
|
184
|
+
return this.write(null)
|
|
185
|
+
},
|
|
186
|
+
flush: function () {
|
|
187
|
+
flushBuffers(this)
|
|
188
|
+
},
|
|
165
189
|
}
|
|
166
190
|
|
|
167
191
|
var Stream
|
|
@@ -176,11 +200,11 @@
|
|
|
176
200
|
return ev !== 'error' && ev !== 'end'
|
|
177
201
|
})
|
|
178
202
|
|
|
179
|
-
function createStream
|
|
203
|
+
function createStream(strict, opt) {
|
|
180
204
|
return new SAXStream(strict, opt)
|
|
181
205
|
}
|
|
182
206
|
|
|
183
|
-
function SAXStream
|
|
207
|
+
function SAXStream(strict, opt) {
|
|
184
208
|
if (!(this instanceof SAXStream)) {
|
|
185
209
|
return new SAXStream(strict, opt)
|
|
186
210
|
}
|
|
@@ -221,26 +245,27 @@
|
|
|
221
245
|
me.on(ev, h)
|
|
222
246
|
},
|
|
223
247
|
enumerable: true,
|
|
224
|
-
configurable: false
|
|
248
|
+
configurable: false,
|
|
225
249
|
})
|
|
226
250
|
})
|
|
227
251
|
}
|
|
228
252
|
|
|
229
253
|
SAXStream.prototype = Object.create(Stream.prototype, {
|
|
230
254
|
constructor: {
|
|
231
|
-
value: SAXStream
|
|
232
|
-
}
|
|
255
|
+
value: SAXStream,
|
|
256
|
+
},
|
|
233
257
|
})
|
|
234
258
|
|
|
235
259
|
SAXStream.prototype.write = function (data) {
|
|
236
|
-
if (
|
|
260
|
+
if (
|
|
261
|
+
typeof Buffer === 'function' &&
|
|
237
262
|
typeof Buffer.isBuffer === 'function' &&
|
|
238
|
-
Buffer.isBuffer(data)
|
|
263
|
+
Buffer.isBuffer(data)
|
|
264
|
+
) {
|
|
239
265
|
if (!this._decoder) {
|
|
240
|
-
|
|
241
|
-
this._decoder = new SD('utf8')
|
|
266
|
+
this._decoder = new TextDecoder('utf8')
|
|
242
267
|
}
|
|
243
|
-
data = this._decoder.
|
|
268
|
+
data = this._decoder.decode(data, { stream: true })
|
|
244
269
|
}
|
|
245
270
|
|
|
246
271
|
this._parser.write(data.toString())
|
|
@@ -252,6 +277,14 @@
|
|
|
252
277
|
if (chunk && chunk.length) {
|
|
253
278
|
this.write(chunk)
|
|
254
279
|
}
|
|
280
|
+
// Flush any remaining decoded data from the TextDecoder
|
|
281
|
+
if (this._decoder) {
|
|
282
|
+
var remaining = this._decoder.decode()
|
|
283
|
+
if (remaining) {
|
|
284
|
+
this._parser.write(remaining)
|
|
285
|
+
this.emit('data', remaining)
|
|
286
|
+
}
|
|
287
|
+
}
|
|
255
288
|
this._parser.end()
|
|
256
289
|
return true
|
|
257
290
|
}
|
|
@@ -260,7 +293,10 @@
|
|
|
260
293
|
var me = this
|
|
261
294
|
if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {
|
|
262
295
|
me._parser['on' + ev] = function () {
|
|
263
|
-
var args =
|
|
296
|
+
var args =
|
|
297
|
+
arguments.length === 1 ?
|
|
298
|
+
[arguments[0]]
|
|
299
|
+
: Array.apply(null, arguments)
|
|
264
300
|
args.splice(0, 0, ev)
|
|
265
301
|
me.emit.apply(me, args)
|
|
266
302
|
}
|
|
@@ -283,30 +319,34 @@
|
|
|
283
319
|
// without a significant breaking change to either this parser, or the
|
|
284
320
|
// JavaScript language. Implementation of an emoji-capable xml parser
|
|
285
321
|
// is left as an exercise for the reader.
|
|
286
|
-
var nameStart =
|
|
322
|
+
var nameStart =
|
|
323
|
+
/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
|
|
287
324
|
|
|
288
|
-
var nameBody =
|
|
325
|
+
var nameBody =
|
|
326
|
+
/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
|
|
289
327
|
|
|
290
|
-
var entityStart =
|
|
291
|
-
|
|
328
|
+
var entityStart =
|
|
329
|
+
/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
|
|
330
|
+
var entityBody =
|
|
331
|
+
/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
|
|
292
332
|
|
|
293
|
-
function isWhitespace
|
|
333
|
+
function isWhitespace(c) {
|
|
294
334
|
return c === ' ' || c === '\n' || c === '\r' || c === '\t'
|
|
295
335
|
}
|
|
296
336
|
|
|
297
|
-
function isQuote
|
|
298
|
-
return c === '"' || c === '
|
|
337
|
+
function isQuote(c) {
|
|
338
|
+
return c === '"' || c === "'"
|
|
299
339
|
}
|
|
300
340
|
|
|
301
|
-
function isAttribEnd
|
|
341
|
+
function isAttribEnd(c) {
|
|
302
342
|
return c === '>' || isWhitespace(c)
|
|
303
343
|
}
|
|
304
344
|
|
|
305
|
-
function isMatch
|
|
345
|
+
function isMatch(regex, c) {
|
|
306
346
|
return regex.test(c)
|
|
307
347
|
}
|
|
308
348
|
|
|
309
|
-
function notMatch
|
|
349
|
+
function notMatch(regex, c) {
|
|
310
350
|
return !isMatch(regex, c)
|
|
311
351
|
}
|
|
312
352
|
|
|
@@ -347,271 +387,271 @@
|
|
|
347
387
|
CLOSE_TAG: S++, // </a
|
|
348
388
|
CLOSE_TAG_SAW_WHITE: S++, // </a >
|
|
349
389
|
SCRIPT: S++, // <script> ...
|
|
350
|
-
SCRIPT_ENDING: S
|
|
390
|
+
SCRIPT_ENDING: S++, // <script> ... <
|
|
351
391
|
}
|
|
352
392
|
|
|
353
393
|
sax.XML_ENTITIES = {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
394
|
+
amp: '&',
|
|
395
|
+
gt: '>',
|
|
396
|
+
lt: '<',
|
|
397
|
+
quot: '"',
|
|
398
|
+
apos: "'",
|
|
359
399
|
}
|
|
360
400
|
|
|
361
401
|
sax.ENTITIES = {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
402
|
+
amp: '&',
|
|
403
|
+
gt: '>',
|
|
404
|
+
lt: '<',
|
|
405
|
+
quot: '"',
|
|
406
|
+
apos: "'",
|
|
407
|
+
AElig: 198,
|
|
408
|
+
Aacute: 193,
|
|
409
|
+
Acirc: 194,
|
|
410
|
+
Agrave: 192,
|
|
411
|
+
Aring: 197,
|
|
412
|
+
Atilde: 195,
|
|
413
|
+
Auml: 196,
|
|
414
|
+
Ccedil: 199,
|
|
415
|
+
ETH: 208,
|
|
416
|
+
Eacute: 201,
|
|
417
|
+
Ecirc: 202,
|
|
418
|
+
Egrave: 200,
|
|
419
|
+
Euml: 203,
|
|
420
|
+
Iacute: 205,
|
|
421
|
+
Icirc: 206,
|
|
422
|
+
Igrave: 204,
|
|
423
|
+
Iuml: 207,
|
|
424
|
+
Ntilde: 209,
|
|
425
|
+
Oacute: 211,
|
|
426
|
+
Ocirc: 212,
|
|
427
|
+
Ograve: 210,
|
|
428
|
+
Oslash: 216,
|
|
429
|
+
Otilde: 213,
|
|
430
|
+
Ouml: 214,
|
|
431
|
+
THORN: 222,
|
|
432
|
+
Uacute: 218,
|
|
433
|
+
Ucirc: 219,
|
|
434
|
+
Ugrave: 217,
|
|
435
|
+
Uuml: 220,
|
|
436
|
+
Yacute: 221,
|
|
437
|
+
aacute: 225,
|
|
438
|
+
acirc: 226,
|
|
439
|
+
aelig: 230,
|
|
440
|
+
agrave: 224,
|
|
441
|
+
aring: 229,
|
|
442
|
+
atilde: 227,
|
|
443
|
+
auml: 228,
|
|
444
|
+
ccedil: 231,
|
|
445
|
+
eacute: 233,
|
|
446
|
+
ecirc: 234,
|
|
447
|
+
egrave: 232,
|
|
448
|
+
eth: 240,
|
|
449
|
+
euml: 235,
|
|
450
|
+
iacute: 237,
|
|
451
|
+
icirc: 238,
|
|
452
|
+
igrave: 236,
|
|
453
|
+
iuml: 239,
|
|
454
|
+
ntilde: 241,
|
|
455
|
+
oacute: 243,
|
|
456
|
+
ocirc: 244,
|
|
457
|
+
ograve: 242,
|
|
458
|
+
oslash: 248,
|
|
459
|
+
otilde: 245,
|
|
460
|
+
ouml: 246,
|
|
461
|
+
szlig: 223,
|
|
462
|
+
thorn: 254,
|
|
463
|
+
uacute: 250,
|
|
464
|
+
ucirc: 251,
|
|
465
|
+
ugrave: 249,
|
|
466
|
+
uuml: 252,
|
|
467
|
+
yacute: 253,
|
|
468
|
+
yuml: 255,
|
|
469
|
+
copy: 169,
|
|
470
|
+
reg: 174,
|
|
471
|
+
nbsp: 160,
|
|
472
|
+
iexcl: 161,
|
|
473
|
+
cent: 162,
|
|
474
|
+
pound: 163,
|
|
475
|
+
curren: 164,
|
|
476
|
+
yen: 165,
|
|
477
|
+
brvbar: 166,
|
|
478
|
+
sect: 167,
|
|
479
|
+
uml: 168,
|
|
480
|
+
ordf: 170,
|
|
481
|
+
laquo: 171,
|
|
482
|
+
not: 172,
|
|
483
|
+
shy: 173,
|
|
484
|
+
macr: 175,
|
|
485
|
+
deg: 176,
|
|
486
|
+
plusmn: 177,
|
|
487
|
+
sup1: 185,
|
|
488
|
+
sup2: 178,
|
|
489
|
+
sup3: 179,
|
|
490
|
+
acute: 180,
|
|
491
|
+
micro: 181,
|
|
492
|
+
para: 182,
|
|
493
|
+
middot: 183,
|
|
494
|
+
cedil: 184,
|
|
495
|
+
ordm: 186,
|
|
496
|
+
raquo: 187,
|
|
497
|
+
frac14: 188,
|
|
498
|
+
frac12: 189,
|
|
499
|
+
frac34: 190,
|
|
500
|
+
iquest: 191,
|
|
501
|
+
times: 215,
|
|
502
|
+
divide: 247,
|
|
503
|
+
OElig: 338,
|
|
504
|
+
oelig: 339,
|
|
505
|
+
Scaron: 352,
|
|
506
|
+
scaron: 353,
|
|
507
|
+
Yuml: 376,
|
|
508
|
+
fnof: 402,
|
|
509
|
+
circ: 710,
|
|
510
|
+
tilde: 732,
|
|
511
|
+
Alpha: 913,
|
|
512
|
+
Beta: 914,
|
|
513
|
+
Gamma: 915,
|
|
514
|
+
Delta: 916,
|
|
515
|
+
Epsilon: 917,
|
|
516
|
+
Zeta: 918,
|
|
517
|
+
Eta: 919,
|
|
518
|
+
Theta: 920,
|
|
519
|
+
Iota: 921,
|
|
520
|
+
Kappa: 922,
|
|
521
|
+
Lambda: 923,
|
|
522
|
+
Mu: 924,
|
|
523
|
+
Nu: 925,
|
|
524
|
+
Xi: 926,
|
|
525
|
+
Omicron: 927,
|
|
526
|
+
Pi: 928,
|
|
527
|
+
Rho: 929,
|
|
528
|
+
Sigma: 931,
|
|
529
|
+
Tau: 932,
|
|
530
|
+
Upsilon: 933,
|
|
531
|
+
Phi: 934,
|
|
532
|
+
Chi: 935,
|
|
533
|
+
Psi: 936,
|
|
534
|
+
Omega: 937,
|
|
535
|
+
alpha: 945,
|
|
536
|
+
beta: 946,
|
|
537
|
+
gamma: 947,
|
|
538
|
+
delta: 948,
|
|
539
|
+
epsilon: 949,
|
|
540
|
+
zeta: 950,
|
|
541
|
+
eta: 951,
|
|
542
|
+
theta: 952,
|
|
543
|
+
iota: 953,
|
|
544
|
+
kappa: 954,
|
|
545
|
+
lambda: 955,
|
|
546
|
+
mu: 956,
|
|
547
|
+
nu: 957,
|
|
548
|
+
xi: 958,
|
|
549
|
+
omicron: 959,
|
|
550
|
+
pi: 960,
|
|
551
|
+
rho: 961,
|
|
552
|
+
sigmaf: 962,
|
|
553
|
+
sigma: 963,
|
|
554
|
+
tau: 964,
|
|
555
|
+
upsilon: 965,
|
|
556
|
+
phi: 966,
|
|
557
|
+
chi: 967,
|
|
558
|
+
psi: 968,
|
|
559
|
+
omega: 969,
|
|
560
|
+
thetasym: 977,
|
|
561
|
+
upsih: 978,
|
|
562
|
+
piv: 982,
|
|
563
|
+
ensp: 8194,
|
|
564
|
+
emsp: 8195,
|
|
565
|
+
thinsp: 8201,
|
|
566
|
+
zwnj: 8204,
|
|
567
|
+
zwj: 8205,
|
|
568
|
+
lrm: 8206,
|
|
569
|
+
rlm: 8207,
|
|
570
|
+
ndash: 8211,
|
|
571
|
+
mdash: 8212,
|
|
572
|
+
lsquo: 8216,
|
|
573
|
+
rsquo: 8217,
|
|
574
|
+
sbquo: 8218,
|
|
575
|
+
ldquo: 8220,
|
|
576
|
+
rdquo: 8221,
|
|
577
|
+
bdquo: 8222,
|
|
578
|
+
dagger: 8224,
|
|
579
|
+
Dagger: 8225,
|
|
580
|
+
bull: 8226,
|
|
581
|
+
hellip: 8230,
|
|
582
|
+
permil: 8240,
|
|
583
|
+
prime: 8242,
|
|
584
|
+
Prime: 8243,
|
|
585
|
+
lsaquo: 8249,
|
|
586
|
+
rsaquo: 8250,
|
|
587
|
+
oline: 8254,
|
|
588
|
+
frasl: 8260,
|
|
589
|
+
euro: 8364,
|
|
590
|
+
image: 8465,
|
|
591
|
+
weierp: 8472,
|
|
592
|
+
real: 8476,
|
|
593
|
+
trade: 8482,
|
|
594
|
+
alefsym: 8501,
|
|
595
|
+
larr: 8592,
|
|
596
|
+
uarr: 8593,
|
|
597
|
+
rarr: 8594,
|
|
598
|
+
darr: 8595,
|
|
599
|
+
harr: 8596,
|
|
600
|
+
crarr: 8629,
|
|
601
|
+
lArr: 8656,
|
|
602
|
+
uArr: 8657,
|
|
603
|
+
rArr: 8658,
|
|
604
|
+
dArr: 8659,
|
|
605
|
+
hArr: 8660,
|
|
606
|
+
forall: 8704,
|
|
607
|
+
part: 8706,
|
|
608
|
+
exist: 8707,
|
|
609
|
+
empty: 8709,
|
|
610
|
+
nabla: 8711,
|
|
611
|
+
isin: 8712,
|
|
612
|
+
notin: 8713,
|
|
613
|
+
ni: 8715,
|
|
614
|
+
prod: 8719,
|
|
615
|
+
sum: 8721,
|
|
616
|
+
minus: 8722,
|
|
617
|
+
lowast: 8727,
|
|
618
|
+
radic: 8730,
|
|
619
|
+
prop: 8733,
|
|
620
|
+
infin: 8734,
|
|
621
|
+
ang: 8736,
|
|
622
|
+
and: 8743,
|
|
623
|
+
or: 8744,
|
|
624
|
+
cap: 8745,
|
|
625
|
+
cup: 8746,
|
|
626
|
+
int: 8747,
|
|
627
|
+
there4: 8756,
|
|
628
|
+
sim: 8764,
|
|
629
|
+
cong: 8773,
|
|
630
|
+
asymp: 8776,
|
|
631
|
+
ne: 8800,
|
|
632
|
+
equiv: 8801,
|
|
633
|
+
le: 8804,
|
|
634
|
+
ge: 8805,
|
|
635
|
+
sub: 8834,
|
|
636
|
+
sup: 8835,
|
|
637
|
+
nsub: 8836,
|
|
638
|
+
sube: 8838,
|
|
639
|
+
supe: 8839,
|
|
640
|
+
oplus: 8853,
|
|
641
|
+
otimes: 8855,
|
|
642
|
+
perp: 8869,
|
|
643
|
+
sdot: 8901,
|
|
644
|
+
lceil: 8968,
|
|
645
|
+
rceil: 8969,
|
|
646
|
+
lfloor: 8970,
|
|
647
|
+
rfloor: 8971,
|
|
648
|
+
lang: 9001,
|
|
649
|
+
rang: 9002,
|
|
650
|
+
loz: 9674,
|
|
651
|
+
spades: 9824,
|
|
652
|
+
clubs: 9827,
|
|
653
|
+
hearts: 9829,
|
|
654
|
+
diams: 9830,
|
|
615
655
|
}
|
|
616
656
|
|
|
617
657
|
Object.keys(sax.ENTITIES).forEach(function (key) {
|
|
@@ -627,33 +667,37 @@
|
|
|
627
667
|
// shorthand
|
|
628
668
|
S = sax.STATE
|
|
629
669
|
|
|
630
|
-
function emit
|
|
670
|
+
function emit(parser, event, data) {
|
|
631
671
|
parser[event] && parser[event](data)
|
|
632
672
|
}
|
|
633
673
|
|
|
634
|
-
function emitNode
|
|
674
|
+
function emitNode(parser, nodeType, data) {
|
|
635
675
|
if (parser.textNode) closeText(parser)
|
|
636
676
|
emit(parser, nodeType, data)
|
|
637
677
|
}
|
|
638
678
|
|
|
639
|
-
function closeText
|
|
679
|
+
function closeText(parser) {
|
|
640
680
|
parser.textNode = textopts(parser.opt, parser.textNode)
|
|
641
681
|
if (parser.textNode) emit(parser, 'ontext', parser.textNode)
|
|
642
682
|
parser.textNode = ''
|
|
643
683
|
}
|
|
644
684
|
|
|
645
|
-
function textopts
|
|
685
|
+
function textopts(opt, text) {
|
|
646
686
|
if (opt.trim) text = text.trim()
|
|
647
687
|
if (opt.normalize) text = text.replace(/\s+/g, ' ')
|
|
648
688
|
return text
|
|
649
689
|
}
|
|
650
690
|
|
|
651
|
-
function error
|
|
691
|
+
function error(parser, er) {
|
|
652
692
|
closeText(parser)
|
|
653
693
|
if (parser.trackPosition) {
|
|
654
|
-
er +=
|
|
655
|
-
'\
|
|
656
|
-
|
|
694
|
+
er +=
|
|
695
|
+
'\nLine: ' +
|
|
696
|
+
parser.line +
|
|
697
|
+
'\nColumn: ' +
|
|
698
|
+
parser.column +
|
|
699
|
+
'\nChar: ' +
|
|
700
|
+
parser.c
|
|
657
701
|
}
|
|
658
702
|
er = new Error(er)
|
|
659
703
|
parser.error = er
|
|
@@ -661,11 +705,14 @@
|
|
|
661
705
|
return parser
|
|
662
706
|
}
|
|
663
707
|
|
|
664
|
-
function end
|
|
665
|
-
if (parser.sawRoot && !parser.closedRoot)
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
708
|
+
function end(parser) {
|
|
709
|
+
if (parser.sawRoot && !parser.closedRoot)
|
|
710
|
+
strictFail(parser, 'Unclosed root tag')
|
|
711
|
+
if (
|
|
712
|
+
parser.state !== S.BEGIN &&
|
|
713
|
+
parser.state !== S.BEGIN_WHITESPACE &&
|
|
714
|
+
parser.state !== S.TEXT
|
|
715
|
+
) {
|
|
669
716
|
error(parser, 'Unexpected end')
|
|
670
717
|
}
|
|
671
718
|
closeText(parser)
|
|
@@ -676,7 +723,7 @@
|
|
|
676
723
|
return parser
|
|
677
724
|
}
|
|
678
725
|
|
|
679
|
-
function strictFail
|
|
726
|
+
function strictFail(parser, message) {
|
|
680
727
|
if (typeof parser !== 'object' || !(parser instanceof SAXParser)) {
|
|
681
728
|
throw new Error('bad call to strictFail')
|
|
682
729
|
}
|
|
@@ -685,10 +732,10 @@
|
|
|
685
732
|
}
|
|
686
733
|
}
|
|
687
734
|
|
|
688
|
-
function newTag
|
|
735
|
+
function newTag(parser) {
|
|
689
736
|
if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
|
|
690
737
|
var parent = parser.tags[parser.tags.length - 1] || parser
|
|
691
|
-
var tag = parser.tag = { name: parser.tagName, attributes: {} }
|
|
738
|
+
var tag = (parser.tag = { name: parser.tagName, attributes: {} })
|
|
692
739
|
|
|
693
740
|
// will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
|
|
694
741
|
if (parser.opt.xmlns) {
|
|
@@ -698,9 +745,9 @@
|
|
|
698
745
|
emitNode(parser, 'onopentagstart', tag)
|
|
699
746
|
}
|
|
700
747
|
|
|
701
|
-
function qname
|
|
748
|
+
function qname(name, attribute) {
|
|
702
749
|
var i = name.indexOf(':')
|
|
703
|
-
var qualName = i < 0 ? [
|
|
750
|
+
var qualName = i < 0 ? ['', name] : name.split(':')
|
|
704
751
|
var prefix = qualName[0]
|
|
705
752
|
var local = qualName[1]
|
|
706
753
|
|
|
@@ -713,13 +760,15 @@
|
|
|
713
760
|
return { prefix: prefix, local: local }
|
|
714
761
|
}
|
|
715
762
|
|
|
716
|
-
function attrib
|
|
763
|
+
function attrib(parser) {
|
|
717
764
|
if (!parser.strict) {
|
|
718
765
|
parser.attribName = parser.attribName[parser.looseCase]()
|
|
719
766
|
}
|
|
720
767
|
|
|
721
|
-
if (
|
|
722
|
-
parser.
|
|
768
|
+
if (
|
|
769
|
+
parser.attribList.indexOf(parser.attribName) !== -1 ||
|
|
770
|
+
parser.tag.attributes.hasOwnProperty(parser.attribName)
|
|
771
|
+
) {
|
|
723
772
|
parser.attribName = parser.attribValue = ''
|
|
724
773
|
return
|
|
725
774
|
}
|
|
@@ -732,13 +781,26 @@
|
|
|
732
781
|
if (prefix === 'xmlns') {
|
|
733
782
|
// namespace binding attribute. push the binding into scope
|
|
734
783
|
if (local === 'xml' && parser.attribValue !== XML_NAMESPACE) {
|
|
735
|
-
strictFail(
|
|
736
|
-
|
|
737
|
-
'
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
784
|
+
strictFail(
|
|
785
|
+
parser,
|
|
786
|
+
'xml: prefix must be bound to ' +
|
|
787
|
+
XML_NAMESPACE +
|
|
788
|
+
'\n' +
|
|
789
|
+
'Actual: ' +
|
|
790
|
+
parser.attribValue
|
|
791
|
+
)
|
|
792
|
+
} else if (
|
|
793
|
+
local === 'xmlns' &&
|
|
794
|
+
parser.attribValue !== XMLNS_NAMESPACE
|
|
795
|
+
) {
|
|
796
|
+
strictFail(
|
|
797
|
+
parser,
|
|
798
|
+
'xmlns: prefix must be bound to ' +
|
|
799
|
+
XMLNS_NAMESPACE +
|
|
800
|
+
'\n' +
|
|
801
|
+
'Actual: ' +
|
|
802
|
+
parser.attribValue
|
|
803
|
+
)
|
|
742
804
|
} else {
|
|
743
805
|
var tag = parser.tag
|
|
744
806
|
var parent = parser.tags[parser.tags.length - 1] || parser
|
|
@@ -758,14 +820,14 @@
|
|
|
758
820
|
parser.tag.attributes[parser.attribName] = parser.attribValue
|
|
759
821
|
emitNode(parser, 'onattribute', {
|
|
760
822
|
name: parser.attribName,
|
|
761
|
-
value: parser.attribValue
|
|
823
|
+
value: parser.attribValue,
|
|
762
824
|
})
|
|
763
825
|
}
|
|
764
826
|
|
|
765
827
|
parser.attribName = parser.attribValue = ''
|
|
766
828
|
}
|
|
767
829
|
|
|
768
|
-
function openTag
|
|
830
|
+
function openTag(parser, selfClosing) {
|
|
769
831
|
if (parser.opt.xmlns) {
|
|
770
832
|
// emit namespace binding events
|
|
771
833
|
var tag = parser.tag
|
|
@@ -777,8 +839,10 @@
|
|
|
777
839
|
tag.uri = tag.ns[qn.prefix] || ''
|
|
778
840
|
|
|
779
841
|
if (tag.prefix && !tag.uri) {
|
|
780
|
-
strictFail(
|
|
781
|
-
|
|
842
|
+
strictFail(
|
|
843
|
+
parser,
|
|
844
|
+
'Unbound namespace prefix: ' + JSON.stringify(parser.tagName)
|
|
845
|
+
)
|
|
782
846
|
tag.uri = qn.prefix
|
|
783
847
|
}
|
|
784
848
|
|
|
@@ -787,7 +851,7 @@
|
|
|
787
851
|
Object.keys(tag.ns).forEach(function (p) {
|
|
788
852
|
emitNode(parser, 'onopennamespace', {
|
|
789
853
|
prefix: p,
|
|
790
|
-
uri: tag.ns[p]
|
|
854
|
+
uri: tag.ns[p],
|
|
791
855
|
})
|
|
792
856
|
})
|
|
793
857
|
}
|
|
@@ -802,20 +866,22 @@
|
|
|
802
866
|
var qualName = qname(name, true)
|
|
803
867
|
var prefix = qualName.prefix
|
|
804
868
|
var local = qualName.local
|
|
805
|
-
var uri = prefix === '' ? '' :
|
|
869
|
+
var uri = prefix === '' ? '' : tag.ns[prefix] || ''
|
|
806
870
|
var a = {
|
|
807
871
|
name: name,
|
|
808
872
|
value: value,
|
|
809
873
|
prefix: prefix,
|
|
810
874
|
local: local,
|
|
811
|
-
uri: uri
|
|
875
|
+
uri: uri,
|
|
812
876
|
}
|
|
813
877
|
|
|
814
878
|
// if there's any attributes with an undefined namespace,
|
|
815
879
|
// then fail on them now.
|
|
816
880
|
if (prefix && prefix !== 'xmlns' && !uri) {
|
|
817
|
-
strictFail(
|
|
818
|
-
|
|
881
|
+
strictFail(
|
|
882
|
+
parser,
|
|
883
|
+
'Unbound namespace prefix: ' + JSON.stringify(prefix)
|
|
884
|
+
)
|
|
819
885
|
a.uri = prefix
|
|
820
886
|
}
|
|
821
887
|
parser.tag.attributes[name] = a
|
|
@@ -844,7 +910,7 @@
|
|
|
844
910
|
parser.attribList.length = 0
|
|
845
911
|
}
|
|
846
912
|
|
|
847
|
-
function closeTag
|
|
913
|
+
function closeTag(parser) {
|
|
848
914
|
if (!parser.tagName) {
|
|
849
915
|
strictFail(parser, 'Weird empty close tag.')
|
|
850
916
|
parser.textNode += '</>'
|
|
@@ -891,7 +957,7 @@
|
|
|
891
957
|
parser.tagName = tagName
|
|
892
958
|
var s = parser.tags.length
|
|
893
959
|
while (s-- > t) {
|
|
894
|
-
var tag = parser.tag = parser.tags.pop()
|
|
960
|
+
var tag = (parser.tag = parser.tags.pop())
|
|
895
961
|
parser.tagName = parser.tag.name
|
|
896
962
|
emitNode(parser, 'onclosetag', parser.tagName)
|
|
897
963
|
|
|
@@ -915,7 +981,7 @@
|
|
|
915
981
|
parser.state = S.TEXT
|
|
916
982
|
}
|
|
917
983
|
|
|
918
|
-
function parseEntity
|
|
984
|
+
function parseEntity(parser) {
|
|
919
985
|
var entity = parser.entity
|
|
920
986
|
var entityLC = entity.toLowerCase()
|
|
921
987
|
var num
|
|
@@ -940,7 +1006,12 @@
|
|
|
940
1006
|
}
|
|
941
1007
|
}
|
|
942
1008
|
entity = entity.replace(/^0+/, '')
|
|
943
|
-
if (
|
|
1009
|
+
if (
|
|
1010
|
+
isNaN(num) ||
|
|
1011
|
+
numStr.toLowerCase() !== entity ||
|
|
1012
|
+
num < 0 ||
|
|
1013
|
+
num > 0x10ffff
|
|
1014
|
+
) {
|
|
944
1015
|
strictFail(parser, 'Invalid character entity')
|
|
945
1016
|
return '&' + parser.entity + ';'
|
|
946
1017
|
}
|
|
@@ -948,7 +1019,7 @@
|
|
|
948
1019
|
return String.fromCodePoint(num)
|
|
949
1020
|
}
|
|
950
1021
|
|
|
951
|
-
function beginWhiteSpace
|
|
1022
|
+
function beginWhiteSpace(parser, c) {
|
|
952
1023
|
if (c === '<') {
|
|
953
1024
|
parser.state = S.OPEN_WAKA
|
|
954
1025
|
parser.startTagPosition = parser.position
|
|
@@ -961,7 +1032,7 @@
|
|
|
961
1032
|
}
|
|
962
1033
|
}
|
|
963
1034
|
|
|
964
|
-
function charAt
|
|
1035
|
+
function charAt(chunk, i) {
|
|
965
1036
|
var result = ''
|
|
966
1037
|
if (i < chunk.length) {
|
|
967
1038
|
result = chunk.charAt(i)
|
|
@@ -969,14 +1040,16 @@
|
|
|
969
1040
|
return result
|
|
970
1041
|
}
|
|
971
1042
|
|
|
972
|
-
function write
|
|
1043
|
+
function write(chunk) {
|
|
973
1044
|
var parser = this
|
|
974
1045
|
if (this.error) {
|
|
975
1046
|
throw this.error
|
|
976
1047
|
}
|
|
977
1048
|
if (parser.closed) {
|
|
978
|
-
return error(
|
|
979
|
-
|
|
1049
|
+
return error(
|
|
1050
|
+
parser,
|
|
1051
|
+
'Cannot write after close. Assign an onready handler.'
|
|
1052
|
+
)
|
|
980
1053
|
}
|
|
981
1054
|
if (chunk === null) {
|
|
982
1055
|
return end(parser)
|
|
@@ -1034,11 +1107,17 @@
|
|
|
1034
1107
|
}
|
|
1035
1108
|
parser.textNode += chunk.substring(starti, i - 1)
|
|
1036
1109
|
}
|
|
1037
|
-
if (
|
|
1110
|
+
if (
|
|
1111
|
+
c === '<' &&
|
|
1112
|
+
!(parser.sawRoot && parser.closedRoot && !parser.strict)
|
|
1113
|
+
) {
|
|
1038
1114
|
parser.state = S.OPEN_WAKA
|
|
1039
1115
|
parser.startTagPosition = parser.position
|
|
1040
1116
|
} else {
|
|
1041
|
-
if (
|
|
1117
|
+
if (
|
|
1118
|
+
!isWhitespace(c) &&
|
|
1119
|
+
(!parser.sawRoot || parser.closedRoot)
|
|
1120
|
+
) {
|
|
1042
1121
|
strictFail(parser, 'Text data outside of root node.')
|
|
1043
1122
|
}
|
|
1044
1123
|
if (c === '&') {
|
|
@@ -1100,10 +1179,14 @@
|
|
|
1100
1179
|
parser.state = S.COMMENT
|
|
1101
1180
|
parser.comment = ''
|
|
1102
1181
|
parser.sgmlDecl = ''
|
|
1103
|
-
continue
|
|
1182
|
+
continue
|
|
1104
1183
|
}
|
|
1105
1184
|
|
|
1106
|
-
if (
|
|
1185
|
+
if (
|
|
1186
|
+
parser.doctype &&
|
|
1187
|
+
parser.doctype !== true &&
|
|
1188
|
+
parser.sgmlDecl
|
|
1189
|
+
) {
|
|
1107
1190
|
parser.state = S.DOCTYPE_DTD
|
|
1108
1191
|
parser.doctype += '<!' + parser.sgmlDecl + c
|
|
1109
1192
|
parser.sgmlDecl = ''
|
|
@@ -1115,8 +1198,10 @@
|
|
|
1115
1198
|
} else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
|
|
1116
1199
|
parser.state = S.DOCTYPE
|
|
1117
1200
|
if (parser.doctype || parser.sawRoot) {
|
|
1118
|
-
strictFail(
|
|
1119
|
-
|
|
1201
|
+
strictFail(
|
|
1202
|
+
parser,
|
|
1203
|
+
'Inappropriately located doctype declaration'
|
|
1204
|
+
)
|
|
1120
1205
|
}
|
|
1121
1206
|
parser.doctype = ''
|
|
1122
1207
|
parser.sgmlDecl = ''
|
|
@@ -1225,10 +1310,22 @@
|
|
|
1225
1310
|
continue
|
|
1226
1311
|
|
|
1227
1312
|
case S.CDATA:
|
|
1313
|
+
var starti = i - 1
|
|
1314
|
+
while (c && c !== ']') {
|
|
1315
|
+
c = charAt(chunk, i++)
|
|
1316
|
+
if (c && parser.trackPosition) {
|
|
1317
|
+
parser.position++
|
|
1318
|
+
if (c === '\n') {
|
|
1319
|
+
parser.line++
|
|
1320
|
+
parser.column = 0
|
|
1321
|
+
} else {
|
|
1322
|
+
parser.column++
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
parser.cdata += chunk.substring(starti, i - 1)
|
|
1228
1327
|
if (c === ']') {
|
|
1229
1328
|
parser.state = S.CDATA_ENDING
|
|
1230
|
-
} else {
|
|
1231
|
-
parser.cdata += c
|
|
1232
1329
|
}
|
|
1233
1330
|
continue
|
|
1234
1331
|
|
|
@@ -1281,7 +1378,7 @@
|
|
|
1281
1378
|
if (c === '>') {
|
|
1282
1379
|
emitNode(parser, 'onprocessinginstruction', {
|
|
1283
1380
|
name: parser.procInstName,
|
|
1284
|
-
body: parser.procInstBody
|
|
1381
|
+
body: parser.procInstBody,
|
|
1285
1382
|
})
|
|
1286
1383
|
parser.procInstName = parser.procInstBody = ''
|
|
1287
1384
|
parser.state = S.TEXT
|
|
@@ -1314,7 +1411,10 @@
|
|
|
1314
1411
|
openTag(parser, true)
|
|
1315
1412
|
closeTag(parser)
|
|
1316
1413
|
} else {
|
|
1317
|
-
strictFail(
|
|
1414
|
+
strictFail(
|
|
1415
|
+
parser,
|
|
1416
|
+
'Forward-slash in opening tag not followed by >'
|
|
1417
|
+
)
|
|
1318
1418
|
parser.state = S.ATTRIB
|
|
1319
1419
|
}
|
|
1320
1420
|
continue
|
|
@@ -1364,7 +1464,7 @@
|
|
|
1364
1464
|
parser.attribValue = ''
|
|
1365
1465
|
emitNode(parser, 'onattribute', {
|
|
1366
1466
|
name: parser.attribName,
|
|
1367
|
-
value: ''
|
|
1467
|
+
value: '',
|
|
1368
1468
|
})
|
|
1369
1469
|
parser.attribName = ''
|
|
1370
1470
|
if (c === '>') {
|
|
@@ -1461,7 +1561,7 @@
|
|
|
1461
1561
|
} else if (isMatch(nameBody, c)) {
|
|
1462
1562
|
parser.tagName += c
|
|
1463
1563
|
} else if (parser.script) {
|
|
1464
|
-
parser.script += '</' + parser.tagName
|
|
1564
|
+
parser.script += '</' + parser.tagName + c
|
|
1465
1565
|
parser.tagName = ''
|
|
1466
1566
|
parser.state = S.SCRIPT
|
|
1467
1567
|
} else {
|
|
@@ -1507,7 +1607,10 @@
|
|
|
1507
1607
|
|
|
1508
1608
|
if (c === ';') {
|
|
1509
1609
|
var parsedEntity = parseEntity(parser)
|
|
1510
|
-
if (
|
|
1610
|
+
if (
|
|
1611
|
+
parser.opt.unparsedEntities &&
|
|
1612
|
+
!Object.values(sax.XML_ENTITIES).includes(parsedEntity)
|
|
1613
|
+
) {
|
|
1511
1614
|
parser.entity = ''
|
|
1512
1615
|
parser.state = returnState
|
|
1513
1616
|
parser.write(parsedEntity)
|
|
@@ -1516,7 +1619,9 @@
|
|
|
1516
1619
|
parser.entity = ''
|
|
1517
1620
|
parser.state = returnState
|
|
1518
1621
|
}
|
|
1519
|
-
} else if (
|
|
1622
|
+
} else if (
|
|
1623
|
+
isMatch(parser.entity.length ? entityBody : entityStart, c)
|
|
1624
|
+
) {
|
|
1520
1625
|
parser.entity += c
|
|
1521
1626
|
} else {
|
|
1522
1627
|
strictFail(parser, 'Invalid character in entity name')
|
|
@@ -1542,7 +1647,7 @@
|
|
|
1542
1647
|
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
|
|
1543
1648
|
/* istanbul ignore next */
|
|
1544
1649
|
if (!String.fromCodePoint) {
|
|
1545
|
-
(function () {
|
|
1650
|
+
;(function () {
|
|
1546
1651
|
var stringFromCharCode = String.fromCharCode
|
|
1547
1652
|
var floor = Math.floor
|
|
1548
1653
|
var fromCodePoint = function () {
|
|
@@ -1561,18 +1666,20 @@
|
|
|
1561
1666
|
if (
|
|
1562
1667
|
!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
|
|
1563
1668
|
codePoint < 0 || // not a valid Unicode code point
|
|
1564
|
-
codePoint >
|
|
1669
|
+
codePoint > 0x10ffff || // not a valid Unicode code point
|
|
1565
1670
|
floor(codePoint) !== codePoint // not an integer
|
|
1566
1671
|
) {
|
|
1567
1672
|
throw RangeError('Invalid code point: ' + codePoint)
|
|
1568
1673
|
}
|
|
1569
|
-
if (codePoint <=
|
|
1674
|
+
if (codePoint <= 0xffff) {
|
|
1675
|
+
// BMP code point
|
|
1570
1676
|
codeUnits.push(codePoint)
|
|
1571
|
-
} else {
|
|
1677
|
+
} else {
|
|
1678
|
+
// Astral code point; split in surrogate halves
|
|
1572
1679
|
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
|
1573
1680
|
codePoint -= 0x10000
|
|
1574
|
-
highSurrogate = (codePoint >> 10) +
|
|
1575
|
-
lowSurrogate = (codePoint % 0x400) +
|
|
1681
|
+
highSurrogate = (codePoint >> 10) + 0xd800
|
|
1682
|
+
lowSurrogate = (codePoint % 0x400) + 0xdc00
|
|
1576
1683
|
codeUnits.push(highSurrogate, lowSurrogate)
|
|
1577
1684
|
}
|
|
1578
1685
|
if (index + 1 === length || codeUnits.length > MAX_SIZE) {
|
|
@@ -1587,11 +1694,11 @@
|
|
|
1587
1694
|
Object.defineProperty(String, 'fromCodePoint', {
|
|
1588
1695
|
value: fromCodePoint,
|
|
1589
1696
|
configurable: true,
|
|
1590
|
-
writable: true
|
|
1697
|
+
writable: true,
|
|
1591
1698
|
})
|
|
1592
1699
|
} else {
|
|
1593
1700
|
String.fromCodePoint = fromCodePoint
|
|
1594
1701
|
}
|
|
1595
|
-
}()
|
|
1702
|
+
})()
|
|
1596
1703
|
}
|
|
1597
|
-
})(typeof exports === 'undefined' ? this.sax = {} : exports)
|
|
1704
|
+
})(typeof exports === 'undefined' ? (this.sax = {}) : exports)
|