plist 3.0.6 → 3.1.0

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.
@@ -4,7 +4,7 @@
4
4
  * Module dependencies.
5
5
  */
6
6
 
7
- var DOMParser = require('./xmldom/dom-parser').DOMParser;
7
+ const { DOMParser } = require('@xmldom/xmldom');
8
8
 
9
9
  /**
10
10
  * Module exports.
@@ -229,7 +229,282 @@ function parsePlistXML (node) {
229
229
  }
230
230
 
231
231
  }).call(this)}).call(this,require("buffer").Buffer)
232
- },{"./xmldom/dom-parser":2,"buffer":7}],2:[function(require,module,exports){
232
+ },{"@xmldom/xmldom":6,"buffer":9}],2:[function(require,module,exports){
233
+ 'use strict'
234
+
235
+ /**
236
+ * Ponyfill for `Array.prototype.find` which is only available in ES6 runtimes.
237
+ *
238
+ * Works with anything that has a `length` property and index access properties, including NodeList.
239
+ *
240
+ * @template {unknown} T
241
+ * @param {Array<T> | ({length:number, [number]: T})} list
242
+ * @param {function (item: T, index: number, list:Array<T> | ({length:number, [number]: T})):boolean} predicate
243
+ * @param {Partial<Pick<ArrayConstructor['prototype'], 'find'>>?} ac `Array.prototype` by default,
244
+ * allows injecting a custom implementation in tests
245
+ * @returns {T | undefined}
246
+ *
247
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
248
+ * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find
249
+ */
250
+ function find(list, predicate, ac) {
251
+ if (ac === undefined) {
252
+ ac = Array.prototype;
253
+ }
254
+ if (list && typeof ac.find === 'function') {
255
+ return ac.find.call(list, predicate);
256
+ }
257
+ for (var i = 0; i < list.length; i++) {
258
+ if (Object.prototype.hasOwnProperty.call(list, i)) {
259
+ var item = list[i];
260
+ if (predicate.call(undefined, item, i, list)) {
261
+ return item;
262
+ }
263
+ }
264
+ }
265
+ }
266
+
267
+ /**
268
+ * "Shallow freezes" an object to render it immutable.
269
+ * Uses `Object.freeze` if available,
270
+ * otherwise the immutability is only in the type.
271
+ *
272
+ * Is used to create "enum like" objects.
273
+ *
274
+ * @template T
275
+ * @param {T} object the object to freeze
276
+ * @param {Pick<ObjectConstructor, 'freeze'> = Object} oc `Object` by default,
277
+ * allows to inject custom object constructor for tests
278
+ * @returns {Readonly<T>}
279
+ *
280
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
281
+ */
282
+ function freeze(object, oc) {
283
+ if (oc === undefined) {
284
+ oc = Object
285
+ }
286
+ return oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object
287
+ }
288
+
289
+ /**
290
+ * Since we can not rely on `Object.assign` we provide a simplified version
291
+ * that is sufficient for our needs.
292
+ *
293
+ * @param {Object} target
294
+ * @param {Object | null | undefined} source
295
+ *
296
+ * @returns {Object} target
297
+ * @throws TypeError if target is not an object
298
+ *
299
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
300
+ * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign
301
+ */
302
+ function assign(target, source) {
303
+ if (target === null || typeof target !== 'object') {
304
+ throw new TypeError('target is not an object')
305
+ }
306
+ for (var key in source) {
307
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
308
+ target[key] = source[key]
309
+ }
310
+ }
311
+ return target
312
+ }
313
+
314
+ /**
315
+ * All mime types that are allowed as input to `DOMParser.parseFromString`
316
+ *
317
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN
318
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec
319
+ * @see DOMParser.prototype.parseFromString
320
+ */
321
+ var MIME_TYPE = freeze({
322
+ /**
323
+ * `text/html`, the only mime type that triggers treating an XML document as HTML.
324
+ *
325
+ * @see DOMParser.SupportedType.isHTML
326
+ * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration
327
+ * @see https://en.wikipedia.org/wiki/HTML Wikipedia
328
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN
329
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec
330
+ */
331
+ HTML: 'text/html',
332
+
333
+ /**
334
+ * Helper method to check a mime type if it indicates an HTML document
335
+ *
336
+ * @param {string} [value]
337
+ * @returns {boolean}
338
+ *
339
+ * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration
340
+ * @see https://en.wikipedia.org/wiki/HTML Wikipedia
341
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN
342
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring */
343
+ isHTML: function (value) {
344
+ return value === MIME_TYPE.HTML
345
+ },
346
+
347
+ /**
348
+ * `application/xml`, the standard mime type for XML documents.
349
+ *
350
+ * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration
351
+ * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303
352
+ * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia
353
+ */
354
+ XML_APPLICATION: 'application/xml',
355
+
356
+ /**
357
+ * `text/html`, an alias for `application/xml`.
358
+ *
359
+ * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303
360
+ * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration
361
+ * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia
362
+ */
363
+ XML_TEXT: 'text/xml',
364
+
365
+ /**
366
+ * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,
367
+ * but is parsed as an XML document.
368
+ *
369
+ * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration
370
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec
371
+ * @see https://en.wikipedia.org/wiki/XHTML Wikipedia
372
+ */
373
+ XML_XHTML_APPLICATION: 'application/xhtml+xml',
374
+
375
+ /**
376
+ * `image/svg+xml`,
377
+ *
378
+ * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration
379
+ * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1
380
+ * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia
381
+ */
382
+ XML_SVG_IMAGE: 'image/svg+xml',
383
+ })
384
+
385
+ /**
386
+ * Namespaces that are used in this code base.
387
+ *
388
+ * @see http://www.w3.org/TR/REC-xml-names
389
+ */
390
+ var NAMESPACE = freeze({
391
+ /**
392
+ * The XHTML namespace.
393
+ *
394
+ * @see http://www.w3.org/1999/xhtml
395
+ */
396
+ HTML: 'http://www.w3.org/1999/xhtml',
397
+
398
+ /**
399
+ * Checks if `uri` equals `NAMESPACE.HTML`.
400
+ *
401
+ * @param {string} [uri]
402
+ *
403
+ * @see NAMESPACE.HTML
404
+ */
405
+ isHTML: function (uri) {
406
+ return uri === NAMESPACE.HTML
407
+ },
408
+
409
+ /**
410
+ * The SVG namespace.
411
+ *
412
+ * @see http://www.w3.org/2000/svg
413
+ */
414
+ SVG: 'http://www.w3.org/2000/svg',
415
+
416
+ /**
417
+ * The `xml:` namespace.
418
+ *
419
+ * @see http://www.w3.org/XML/1998/namespace
420
+ */
421
+ XML: 'http://www.w3.org/XML/1998/namespace',
422
+
423
+ /**
424
+ * The `xmlns:` namespace
425
+ *
426
+ * @see https://www.w3.org/2000/xmlns/
427
+ */
428
+ XMLNS: 'http://www.w3.org/2000/xmlns/',
429
+ })
430
+
431
+ exports.assign = assign;
432
+ exports.find = find;
433
+ exports.freeze = freeze;
434
+ exports.MIME_TYPE = MIME_TYPE;
435
+ exports.NAMESPACE = NAMESPACE;
436
+
437
+ },{}],3:[function(require,module,exports){
438
+ var conventions = require("./conventions");
439
+ var dom = require('./dom')
440
+ var entities = require('./entities');
441
+ var sax = require('./sax');
442
+
443
+ var DOMImplementation = dom.DOMImplementation;
444
+
445
+ var NAMESPACE = conventions.NAMESPACE;
446
+
447
+ var ParseError = sax.ParseError;
448
+ var XMLReader = sax.XMLReader;
449
+
450
+ /**
451
+ * Normalizes line ending according to https://www.w3.org/TR/xml11/#sec-line-ends:
452
+ *
453
+ * > XML parsed entities are often stored in computer files which,
454
+ * > for editing convenience, are organized into lines.
455
+ * > These lines are typically separated by some combination
456
+ * > of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA).
457
+ * >
458
+ * > To simplify the tasks of applications, the XML processor must behave
459
+ * > as if it normalized all line breaks in external parsed entities (including the document entity)
460
+ * > on input, before parsing, by translating all of the following to a single #xA character:
461
+ * >
462
+ * > 1. the two-character sequence #xD #xA
463
+ * > 2. the two-character sequence #xD #x85
464
+ * > 3. the single character #x85
465
+ * > 4. the single character #x2028
466
+ * > 5. any #xD character that is not immediately followed by #xA or #x85.
467
+ *
468
+ * @param {string} input
469
+ * @returns {string}
470
+ */
471
+ function normalizeLineEndings(input) {
472
+ return input
473
+ .replace(/\r[\n\u0085]/g, '\n')
474
+ .replace(/[\r\u0085\u2028]/g, '\n')
475
+ }
476
+
477
+ /**
478
+ * @typedef Locator
479
+ * @property {number} [columnNumber]
480
+ * @property {number} [lineNumber]
481
+ */
482
+
483
+ /**
484
+ * @typedef DOMParserOptions
485
+ * @property {DOMHandler} [domBuilder]
486
+ * @property {Function} [errorHandler]
487
+ * @property {(string) => string} [normalizeLineEndings] used to replace line endings before parsing
488
+ * defaults to `normalizeLineEndings`
489
+ * @property {Locator} [locator]
490
+ * @property {Record<string, string>} [xmlns]
491
+ *
492
+ * @see normalizeLineEndings
493
+ */
494
+
495
+ /**
496
+ * The DOMParser interface provides the ability to parse XML or HTML source code
497
+ * from a string into a DOM `Document`.
498
+ *
499
+ * _xmldom is different from the spec in that it allows an `options` parameter,
500
+ * to override the default behavior._
501
+ *
502
+ * @param {DOMParserOptions} [options]
503
+ * @constructor
504
+ *
505
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser
506
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization
507
+ */
233
508
  function DOMParser(options){
234
509
  this.options = options ||{locator:{}};
235
510
  }
@@ -242,7 +517,7 @@ DOMParser.prototype.parseFromString = function(source,mimeType){
242
517
  var locator = options.locator;
243
518
  var defaultNSMap = options.xmlns||{};
244
519
  var isHTML = /\/x?html?$/.test(mimeType);//mimeType.toLowerCase().indexOf('html') > -1;
245
- var entityMap = isHTML?htmlEntity.entityMap:{'lt':'<','gt':'>','amp':'&','quot':'"','apos':"'"};
520
+ var entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;
246
521
  if(locator){
247
522
  domBuilder.setDocumentLocator(locator)
248
523
  }
@@ -250,13 +525,18 @@ DOMParser.prototype.parseFromString = function(source,mimeType){
250
525
  sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);
251
526
  sax.domBuilder = options.domBuilder || domBuilder;
252
527
  if(isHTML){
253
- defaultNSMap['']= 'http://www.w3.org/1999/xhtml';
528
+ defaultNSMap[''] = NAMESPACE.HTML;
254
529
  }
255
- defaultNSMap.xml = defaultNSMap.xml || 'http://www.w3.org/XML/1998/namespace';
256
- if(source && typeof source === 'string'){
257
- sax.parse(source,defaultNSMap,entityMap);
258
- }else{
259
- sax.errorHandler.error("invalid doc source");
530
+ defaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;
531
+ var normalize = options.normalizeLineEndings || normalizeLineEndings;
532
+ if (source && typeof source === 'string') {
533
+ sax.parse(
534
+ normalize(source),
535
+ defaultNSMap,
536
+ entityMap
537
+ )
538
+ } else {
539
+ sax.errorHandler.error('invalid doc source')
260
540
  }
261
541
  return domBuilder.doc;
262
542
  }
@@ -397,6 +677,7 @@ DOMHandler.prototype = {
397
677
  var dt = impl.createDocumentType(name, publicId, systemId);
398
678
  this.locator && position(this.locator,dt)
399
679
  appendElement(this, dt);
680
+ this.doc.doctype = dt;
400
681
  }
401
682
  },
402
683
  /**
@@ -473,23 +754,82 @@ function appendElement (hander,node) {
473
754
  }
474
755
  }//appendChild and setAttributeNS are preformance key
475
756
 
476
- //if(typeof require == 'function'){
477
- var htmlEntity = require('./entities');
478
- var sax = require('./sax');
479
- var XMLReader = sax.XMLReader;
480
- var ParseError = sax.ParseError;
481
- var DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation;
482
- exports.XMLSerializer = require('./dom').XMLSerializer ;
483
- exports.DOMParser = DOMParser;
484
757
  exports.__DOMHandler = DOMHandler;
485
- //}
758
+ exports.normalizeLineEndings = normalizeLineEndings;
759
+ exports.DOMParser = DOMParser;
760
+
761
+ },{"./conventions":2,"./dom":4,"./entities":5,"./sax":7}],4:[function(require,module,exports){
762
+ var conventions = require("./conventions");
763
+
764
+ var find = conventions.find;
765
+ var NAMESPACE = conventions.NAMESPACE;
766
+
767
+ /**
768
+ * A prerequisite for `[].filter`, to drop elements that are empty
769
+ * @param {string} input
770
+ * @returns {boolean}
771
+ */
772
+ function notEmptyString (input) {
773
+ return input !== ''
774
+ }
775
+ /**
776
+ * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace
777
+ * @see https://infra.spec.whatwg.org/#ascii-whitespace
778
+ *
779
+ * @param {string} input
780
+ * @returns {string[]} (can be empty)
781
+ */
782
+ function splitOnASCIIWhitespace(input) {
783
+ // U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE
784
+ return input ? input.split(/[\t\n\f\r ]+/).filter(notEmptyString) : []
785
+ }
786
+
787
+ /**
788
+ * Adds element as a key to current if it is not already present.
789
+ *
790
+ * @param {Record<string, boolean | undefined>} current
791
+ * @param {string} element
792
+ * @returns {Record<string, boolean | undefined>}
793
+ */
794
+ function orderedSetReducer (current, element) {
795
+ if (!current.hasOwnProperty(element)) {
796
+ current[element] = true;
797
+ }
798
+ return current;
799
+ }
800
+
801
+ /**
802
+ * @see https://infra.spec.whatwg.org/#ordered-set
803
+ * @param {string} input
804
+ * @returns {string[]}
805
+ */
806
+ function toOrderedSet(input) {
807
+ if (!input) return [];
808
+ var list = splitOnASCIIWhitespace(input);
809
+ return Object.keys(list.reduce(orderedSetReducer, {}))
810
+ }
811
+
812
+ /**
813
+ * Uses `list.indexOf` to implement something like `Array.prototype.includes`,
814
+ * which we can not rely on being available.
815
+ *
816
+ * @param {any[]} list
817
+ * @returns {function(any): boolean}
818
+ */
819
+ function arrayIncludes (list) {
820
+ return function(element) {
821
+ return list && list.indexOf(element) !== -1;
822
+ }
823
+ }
486
824
 
487
- },{"./dom":3,"./entities":4,"./sax":5}],3:[function(require,module,exports){
488
825
  function copy(src,dest){
489
826
  for(var p in src){
490
- dest[p] = src[p];
827
+ if (Object.prototype.hasOwnProperty.call(src, p)) {
828
+ dest[p] = src[p];
829
+ }
491
830
  }
492
831
  }
832
+
493
833
  /**
494
834
  ^\w+\.prototype\.([_\w]+)\s*=\s*((?:.*\{\s*?[\r\n][\s\S]*?^})|\S.*?(?=[;\r\n]));?
495
835
  ^\w+\.prototype\.([_\w]+)\s*=\s*(\S.*?(?=[;\r\n]));?
@@ -505,12 +845,12 @@ function _extends(Class,Super){
505
845
  }
506
846
  if(pt.constructor != Class){
507
847
  if(typeof Class != 'function'){
508
- console.error("unknow Class:"+Class)
848
+ console.error("unknown Class:"+Class)
509
849
  }
510
850
  pt.constructor = Class
511
851
  }
512
852
  }
513
- var htmlns = 'http://www.w3.org/1999/xhtml' ;
853
+
514
854
  // Node Types
515
855
  var NodeType = {}
516
856
  var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;
@@ -567,6 +907,7 @@ function DOMException(code, message) {
567
907
  };
568
908
  DOMException.prototype = Error.prototype;
569
909
  copy(ExceptionCode,DOMException)
910
+
570
911
  /**
571
912
  * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177
572
913
  * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.
@@ -579,14 +920,14 @@ NodeList.prototype = {
579
920
  * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.
580
921
  * @standard level1
581
922
  */
582
- length:0,
923
+ length:0,
583
924
  /**
584
925
  * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.
585
926
  * @standard level1
586
- * @param index unsigned long
927
+ * @param index unsigned long
587
928
  * Index into the collection.
588
929
  * @return Node
589
- * The node at the indexth position in the NodeList, or null if that is not a valid index.
930
+ * The node at the indexth position in the NodeList, or null if that is not a valid index.
590
931
  */
591
932
  item: function(index) {
592
933
  return this[index] || null;
@@ -596,8 +937,25 @@ NodeList.prototype = {
596
937
  serializeToString(this[i],buf,isHTML,nodeFilter);
597
938
  }
598
939
  return buf.join('');
599
- }
940
+ },
941
+ /**
942
+ * @private
943
+ * @param {function (Node):boolean} predicate
944
+ * @returns {Node[]}
945
+ */
946
+ filter: function (predicate) {
947
+ return Array.prototype.filter.call(this, predicate);
948
+ },
949
+ /**
950
+ * @private
951
+ * @param {Node} item
952
+ * @returns {number}
953
+ */
954
+ indexOf: function (item) {
955
+ return Array.prototype.indexOf.call(this, item);
956
+ },
600
957
  };
958
+
601
959
  function LiveNodeList(node,refresh){
602
960
  this._node = node;
603
961
  this._refresh = refresh
@@ -619,11 +977,17 @@ LiveNodeList.prototype.item = function(i){
619
977
  }
620
978
 
621
979
  _extends(LiveNodeList,NodeList);
980
+
622
981
  /**
623
- *
624
- * Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, and does not imply that the DOM specifies an order to these Nodes.
982
+ * Objects implementing the NamedNodeMap interface are used
983
+ * to represent collections of nodes that can be accessed by name.
984
+ * Note that NamedNodeMap does not inherit from NodeList;
985
+ * NamedNodeMaps are not maintained in any particular order.
986
+ * Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index,
987
+ * but this is simply to allow convenient enumeration of the contents of a NamedNodeMap,
988
+ * and does not imply that the DOM specifies an order to these Nodes.
625
989
  * NamedNodeMap objects in the DOM are live.
626
- * used for attributes or DocumentType entities
990
+ * used for attributes or DocumentType entities
627
991
  */
628
992
  function NamedNodeMap() {
629
993
  };
@@ -667,7 +1031,7 @@ function _removeNamedNode(el,list,attr){
667
1031
  }
668
1032
  }
669
1033
  }else{
670
- throw DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))
1034
+ throw new DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))
671
1035
  }
672
1036
  }
673
1037
  NamedNodeMap.prototype = {
@@ -712,10 +1076,10 @@ NamedNodeMap.prototype = {
712
1076
  var attr = this.getNamedItem(key);
713
1077
  _removeNamedNode(this._ownerElement,this,attr);
714
1078
  return attr;
715
-
716
-
1079
+
1080
+
717
1081
  },// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR
718
-
1082
+
719
1083
  //for level2
720
1084
  removeNamedItemNS:function(namespaceURI,localName){
721
1085
  var attr = this.getNamedItemNS(namespaceURI,localName);
@@ -733,55 +1097,108 @@ NamedNodeMap.prototype = {
733
1097
  return null;
734
1098
  }
735
1099
  };
1100
+
736
1101
  /**
737
- * @see http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490
1102
+ * The DOMImplementation interface represents an object providing methods
1103
+ * which are not dependent on any particular document.
1104
+ * Such an object is returned by the `Document.implementation` property.
1105
+ *
1106
+ * __The individual methods describe the differences compared to the specs.__
1107
+ *
1108
+ * @constructor
1109
+ *
1110
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN
1111
+ * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial)
1112
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core
1113
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core
1114
+ * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard
738
1115
  */
739
- function DOMImplementation(/* Object */ features) {
740
- this._features = {};
741
- if (features) {
742
- for (var feature in features) {
743
- this._features = features[feature];
744
- }
745
- }
746
- };
1116
+ function DOMImplementation() {
1117
+ }
747
1118
 
748
1119
  DOMImplementation.prototype = {
749
- hasFeature: function(/* string */ feature, /* string */ version) {
750
- var versions = this._features[feature.toLowerCase()];
751
- if (versions && (!version || version in versions)) {
1120
+ /**
1121
+ * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.
1122
+ * The different implementations fairly diverged in what kind of features were reported.
1123
+ * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.
1124
+ *
1125
+ * @deprecated It is deprecated and modern browsers return true in all cases.
1126
+ *
1127
+ * @param {string} feature
1128
+ * @param {string} [version]
1129
+ * @returns {boolean} always true
1130
+ *
1131
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN
1132
+ * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core
1133
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard
1134
+ */
1135
+ hasFeature: function(feature, version) {
752
1136
  return true;
753
- } else {
754
- return false;
755
- }
756
1137
  },
757
- // Introduced in DOM Level 2:
758
- createDocument:function(namespaceURI, qualifiedName, doctype){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR,WRONG_DOCUMENT_ERR
1138
+ /**
1139
+ * Creates an XML Document object of the specified type with its document element.
1140
+ *
1141
+ * __It behaves slightly different from the description in the living standard__:
1142
+ * - There is no interface/class `XMLDocument`, it returns a `Document` instance.
1143
+ * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.
1144
+ * - this implementation is not validating names or qualified names
1145
+ * (when parsing XML strings, the SAX parser takes care of that)
1146
+ *
1147
+ * @param {string|null} namespaceURI
1148
+ * @param {string} qualifiedName
1149
+ * @param {DocumentType=null} doctype
1150
+ * @returns {Document}
1151
+ *
1152
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN
1153
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)
1154
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core
1155
+ *
1156
+ * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract
1157
+ * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names
1158
+ * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names
1159
+ */
1160
+ createDocument: function(namespaceURI, qualifiedName, doctype){
759
1161
  var doc = new Document();
760
1162
  doc.implementation = this;
761
1163
  doc.childNodes = new NodeList();
762
- doc.doctype = doctype;
763
- if(doctype){
1164
+ doc.doctype = doctype || null;
1165
+ if (doctype){
764
1166
  doc.appendChild(doctype);
765
1167
  }
766
- if(qualifiedName){
767
- var root = doc.createElementNS(namespaceURI,qualifiedName);
1168
+ if (qualifiedName){
1169
+ var root = doc.createElementNS(namespaceURI, qualifiedName);
768
1170
  doc.appendChild(root);
769
1171
  }
770
1172
  return doc;
771
1173
  },
772
- // Introduced in DOM Level 2:
773
- createDocumentType:function(qualifiedName, publicId, systemId){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR
1174
+ /**
1175
+ * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
1176
+ *
1177
+ * __This behavior is slightly different from the in the specs__:
1178
+ * - this implementation is not validating names or qualified names
1179
+ * (when parsing XML strings, the SAX parser takes care of that)
1180
+ *
1181
+ * @param {string} qualifiedName
1182
+ * @param {string} [publicId]
1183
+ * @param {string} [systemId]
1184
+ * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
1185
+ * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
1186
+ *
1187
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN
1188
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core
1189
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard
1190
+ *
1191
+ * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract
1192
+ * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names
1193
+ * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names
1194
+ */
1195
+ createDocumentType: function(qualifiedName, publicId, systemId){
774
1196
  var node = new DocumentType();
775
1197
  node.name = qualifiedName;
776
1198
  node.nodeName = qualifiedName;
777
- node.publicId = publicId;
778
- node.systemId = systemId;
779
- // Introduced in DOM Level 2:
780
- //readonly attribute DOMString internalSubset;
781
-
782
- //TODO:..
783
- // readonly attribute NamedNodeMap entities;
784
- // readonly attribute NamedNodeMap notations;
1199
+ node.publicId = publicId || '';
1200
+ node.systemId = systemId || '';
1201
+
785
1202
  return node;
786
1203
  }
787
1204
  };
@@ -808,11 +1225,11 @@ Node.prototype = {
808
1225
  prefix : null,
809
1226
  localName : null,
810
1227
  // Modified in DOM Level 2:
811
- insertBefore:function(newChild, refChild){//raises
1228
+ insertBefore:function(newChild, refChild){//raises
812
1229
  return _insertBefore(this,newChild,refChild);
813
1230
  },
814
- replaceChild:function(newChild, oldChild){//raises
815
- this.insertBefore(newChild,oldChild);
1231
+ replaceChild:function(newChild, oldChild){//raises
1232
+ _insertBefore(this, newChild,oldChild, assertPreReplacementValidityInDocument);
816
1233
  if(oldChild){
817
1234
  this.removeChild(oldChild);
818
1235
  }
@@ -851,6 +1268,20 @@ Node.prototype = {
851
1268
  hasAttributes:function(){
852
1269
  return this.attributes.length>0;
853
1270
  },
1271
+ /**
1272
+ * Look up the prefix associated to the given namespace URI, starting from this node.
1273
+ * **The default namespace declarations are ignored by this method.**
1274
+ * See Namespace Prefix Lookup for details on the algorithm used by this method.
1275
+ *
1276
+ * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._
1277
+ *
1278
+ * @param {string | null} namespaceURI
1279
+ * @returns {string | null}
1280
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix
1281
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo
1282
+ * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix
1283
+ * @see https://github.com/xmldom/xmldom/issues/322
1284
+ */
854
1285
  lookupPrefix:function(namespaceURI){
855
1286
  var el = this;
856
1287
  while(el){
@@ -858,9 +1289,9 @@ Node.prototype = {
858
1289
  //console.dir(map)
859
1290
  if(map){
860
1291
  for(var n in map){
861
- if(map[n] == namespaceURI){
862
- return n;
863
- }
1292
+ if (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {
1293
+ return n;
1294
+ }
864
1295
  }
865
1296
  }
866
1297
  el = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;
@@ -874,7 +1305,7 @@ Node.prototype = {
874
1305
  var map = el._nsMap;
875
1306
  //console.dir(map)
876
1307
  if(map){
877
- if(prefix in map){
1308
+ if(Object.prototype.hasOwnProperty.call(map, prefix)){
878
1309
  return map[prefix] ;
879
1310
  }
880
1311
  }
@@ -920,140 +1351,442 @@ function _visitNode(node,callback){
920
1351
 
921
1352
 
922
1353
  function Document(){
1354
+ this.ownerDocument = this;
923
1355
  }
1356
+
924
1357
  function _onAddAttribute(doc,el,newAttr){
925
1358
  doc && doc._inc++;
926
1359
  var ns = newAttr.namespaceURI ;
927
- if(ns == 'http://www.w3.org/2000/xmlns/'){
1360
+ if(ns === NAMESPACE.XMLNS){
928
1361
  //update namespace
929
1362
  el._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value
930
1363
  }
931
1364
  }
1365
+
932
1366
  function _onRemoveAttribute(doc,el,newAttr,remove){
933
1367
  doc && doc._inc++;
934
1368
  var ns = newAttr.namespaceURI ;
935
- if(ns == 'http://www.w3.org/2000/xmlns/'){
1369
+ if(ns === NAMESPACE.XMLNS){
936
1370
  //update namespace
937
1371
  delete el._nsMap[newAttr.prefix?newAttr.localName:'']
938
1372
  }
939
1373
  }
940
- function _onUpdateChild(doc,el,newChild){
1374
+
1375
+ /**
1376
+ * Updates `el.childNodes`, updating the indexed items and it's `length`.
1377
+ * Passing `newChild` means it will be appended.
1378
+ * Otherwise it's assumed that an item has been removed,
1379
+ * and `el.firstNode` and it's `.nextSibling` are used
1380
+ * to walk the current list of child nodes.
1381
+ *
1382
+ * @param {Document} doc
1383
+ * @param {Node} el
1384
+ * @param {Node} [newChild]
1385
+ * @private
1386
+ */
1387
+ function _onUpdateChild (doc, el, newChild) {
941
1388
  if(doc && doc._inc){
942
1389
  doc._inc++;
943
1390
  //update childNodes
944
1391
  var cs = el.childNodes;
945
- if(newChild){
1392
+ if (newChild) {
946
1393
  cs[cs.length++] = newChild;
947
- }else{
948
- //console.log(1)
1394
+ } else {
949
1395
  var child = el.firstChild;
950
1396
  var i = 0;
951
- while(child){
1397
+ while (child) {
952
1398
  cs[i++] = child;
953
- child =child.nextSibling;
1399
+ child = child.nextSibling;
954
1400
  }
955
1401
  cs.length = i;
1402
+ delete cs[cs.length];
956
1403
  }
957
1404
  }
958
1405
  }
959
1406
 
960
1407
  /**
961
- * attributes;
962
- * children;
963
- *
964
- * writeable properties:
965
- * nodeValue,Attr:value,CharacterData:data
966
- * prefix
1408
+ * Removes the connections between `parentNode` and `child`
1409
+ * and any existing `child.previousSibling` or `child.nextSibling`.
1410
+ *
1411
+ * @see https://github.com/xmldom/xmldom/issues/135
1412
+ * @see https://github.com/xmldom/xmldom/issues/145
1413
+ *
1414
+ * @param {Node} parentNode
1415
+ * @param {Node} child
1416
+ * @returns {Node} the child that was removed.
1417
+ * @private
967
1418
  */
968
- function _removeChild(parentNode,child){
1419
+ function _removeChild (parentNode, child) {
969
1420
  var previous = child.previousSibling;
970
1421
  var next = child.nextSibling;
971
- if(previous){
1422
+ if (previous) {
972
1423
  previous.nextSibling = next;
973
- }else{
974
- parentNode.firstChild = next
1424
+ } else {
1425
+ parentNode.firstChild = next;
975
1426
  }
976
- if(next){
1427
+ if (next) {
977
1428
  next.previousSibling = previous;
978
- }else{
1429
+ } else {
979
1430
  parentNode.lastChild = previous;
980
1431
  }
981
- _onUpdateChild(parentNode.ownerDocument,parentNode);
1432
+ child.parentNode = null;
1433
+ child.previousSibling = null;
1434
+ child.nextSibling = null;
1435
+ _onUpdateChild(parentNode.ownerDocument, parentNode);
982
1436
  return child;
983
1437
  }
1438
+
1439
+ /**
1440
+ * Returns `true` if `node` can be a parent for insertion.
1441
+ * @param {Node} node
1442
+ * @returns {boolean}
1443
+ */
1444
+ function hasValidParentNodeType(node) {
1445
+ return (
1446
+ node &&
1447
+ (node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE)
1448
+ );
1449
+ }
1450
+
1451
+ /**
1452
+ * Returns `true` if `node` can be inserted according to it's `nodeType`.
1453
+ * @param {Node} node
1454
+ * @returns {boolean}
1455
+ */
1456
+ function hasInsertableNodeType(node) {
1457
+ return (
1458
+ node &&
1459
+ (isElementNode(node) ||
1460
+ isTextNode(node) ||
1461
+ isDocTypeNode(node) ||
1462
+ node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ||
1463
+ node.nodeType === Node.COMMENT_NODE ||
1464
+ node.nodeType === Node.PROCESSING_INSTRUCTION_NODE)
1465
+ );
1466
+ }
1467
+
1468
+ /**
1469
+ * Returns true if `node` is a DOCTYPE node
1470
+ * @param {Node} node
1471
+ * @returns {boolean}
1472
+ */
1473
+ function isDocTypeNode(node) {
1474
+ return node && node.nodeType === Node.DOCUMENT_TYPE_NODE;
1475
+ }
1476
+
1477
+ /**
1478
+ * Returns true if the node is an element
1479
+ * @param {Node} node
1480
+ * @returns {boolean}
1481
+ */
1482
+ function isElementNode(node) {
1483
+ return node && node.nodeType === Node.ELEMENT_NODE;
1484
+ }
1485
+ /**
1486
+ * Returns true if `node` is a text node
1487
+ * @param {Node} node
1488
+ * @returns {boolean}
1489
+ */
1490
+ function isTextNode(node) {
1491
+ return node && node.nodeType === Node.TEXT_NODE;
1492
+ }
1493
+
1494
+ /**
1495
+ * Check if en element node can be inserted before `child`, or at the end if child is falsy,
1496
+ * according to the presence and position of a doctype node on the same level.
1497
+ *
1498
+ * @param {Document} doc The document node
1499
+ * @param {Node} child the node that would become the nextSibling if the element would be inserted
1500
+ * @returns {boolean} `true` if an element can be inserted before child
1501
+ * @private
1502
+ * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
1503
+ */
1504
+ function isElementInsertionPossible(doc, child) {
1505
+ var parentChildNodes = doc.childNodes || [];
1506
+ if (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {
1507
+ return false;
1508
+ }
1509
+ var docTypeNode = find(parentChildNodes, isDocTypeNode);
1510
+ return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
1511
+ }
1512
+
1513
+ /**
1514
+ * Check if en element node can be inserted before `child`, or at the end if child is falsy,
1515
+ * according to the presence and position of a doctype node on the same level.
1516
+ *
1517
+ * @param {Node} doc The document node
1518
+ * @param {Node} child the node that would become the nextSibling if the element would be inserted
1519
+ * @returns {boolean} `true` if an element can be inserted before child
1520
+ * @private
1521
+ * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
1522
+ */
1523
+ function isElementReplacementPossible(doc, child) {
1524
+ var parentChildNodes = doc.childNodes || [];
1525
+
1526
+ function hasElementChildThatIsNotChild(node) {
1527
+ return isElementNode(node) && node !== child;
1528
+ }
1529
+
1530
+ if (find(parentChildNodes, hasElementChildThatIsNotChild)) {
1531
+ return false;
1532
+ }
1533
+ var docTypeNode = find(parentChildNodes, isDocTypeNode);
1534
+ return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
1535
+ }
1536
+
1537
+ /**
1538
+ * @private
1539
+ * Steps 1-5 of the checks before inserting and before replacing a child are the same.
1540
+ *
1541
+ * @param {Node} parent the parent node to insert `node` into
1542
+ * @param {Node} node the node to insert
1543
+ * @param {Node=} child the node that should become the `nextSibling` of `node`
1544
+ * @returns {Node}
1545
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
1546
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
1547
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
1548
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
1549
+ */
1550
+ function assertPreInsertionValidity1to5(parent, node, child) {
1551
+ // 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a "HierarchyRequestError" DOMException.
1552
+ if (!hasValidParentNodeType(parent)) {
1553
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType);
1554
+ }
1555
+ // 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a "HierarchyRequestError" DOMException.
1556
+ // not implemented!
1557
+ // 3. If `child` is non-null and its parent is not `parent`, then throw a "NotFoundError" DOMException.
1558
+ if (child && child.parentNode !== parent) {
1559
+ throw new DOMException(NOT_FOUND_ERR, 'child not in parent');
1560
+ }
1561
+ if (
1562
+ // 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a "HierarchyRequestError" DOMException.
1563
+ !hasInsertableNodeType(node) ||
1564
+ // 5. If either `node` is a Text node and `parent` is a document,
1565
+ // the sax parser currently adds top level text nodes, this will be fixed in 0.9.0
1566
+ // || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE)
1567
+ // or `node` is a doctype and `parent` is not a document, then throw a "HierarchyRequestError" DOMException.
1568
+ (isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE)
1569
+ ) {
1570
+ throw new DOMException(
1571
+ HIERARCHY_REQUEST_ERR,
1572
+ 'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType
1573
+ );
1574
+ }
1575
+ }
1576
+
1577
+ /**
1578
+ * @private
1579
+ * Step 6 of the checks before inserting and before replacing a child are different.
1580
+ *
1581
+ * @param {Document} parent the parent node to insert `node` into
1582
+ * @param {Node} node the node to insert
1583
+ * @param {Node | undefined} child the node that should become the `nextSibling` of `node`
1584
+ * @returns {Node}
1585
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
1586
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
1587
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
1588
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
1589
+ */
1590
+ function assertPreInsertionValidityInDocument(parent, node, child) {
1591
+ var parentChildNodes = parent.childNodes || [];
1592
+ var nodeChildNodes = node.childNodes || [];
1593
+
1594
+ // DocumentFragment
1595
+ if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
1596
+ var nodeChildElements = nodeChildNodes.filter(isElementNode);
1597
+ // If node has more than one element child or has a Text node child.
1598
+ if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {
1599
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');
1600
+ }
1601
+ // Otherwise, if `node` has one element child and either `parent` has an element child,
1602
+ // `child` is a doctype, or `child` is non-null and a doctype is following `child`.
1603
+ if (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {
1604
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');
1605
+ }
1606
+ }
1607
+ // Element
1608
+ if (isElementNode(node)) {
1609
+ // `parent` has an element child, `child` is a doctype,
1610
+ // or `child` is non-null and a doctype is following `child`.
1611
+ if (!isElementInsertionPossible(parent, child)) {
1612
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');
1613
+ }
1614
+ }
1615
+ // DocumentType
1616
+ if (isDocTypeNode(node)) {
1617
+ // `parent` has a doctype child,
1618
+ if (find(parentChildNodes, isDocTypeNode)) {
1619
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');
1620
+ }
1621
+ var parentElementChild = find(parentChildNodes, isElementNode);
1622
+ // `child` is non-null and an element is preceding `child`,
1623
+ if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
1624
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');
1625
+ }
1626
+ // or `child` is null and `parent` has an element child.
1627
+ if (!child && parentElementChild) {
1628
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present');
1629
+ }
1630
+ }
1631
+ }
1632
+
1633
+ /**
1634
+ * @private
1635
+ * Step 6 of the checks before inserting and before replacing a child are different.
1636
+ *
1637
+ * @param {Document} parent the parent node to insert `node` into
1638
+ * @param {Node} node the node to insert
1639
+ * @param {Node | undefined} child the node that should become the `nextSibling` of `node`
1640
+ * @returns {Node}
1641
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
1642
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
1643
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
1644
+ * @see https://dom.spec.whatwg.org/#concept-node-replace
1645
+ */
1646
+ function assertPreReplacementValidityInDocument(parent, node, child) {
1647
+ var parentChildNodes = parent.childNodes || [];
1648
+ var nodeChildNodes = node.childNodes || [];
1649
+
1650
+ // DocumentFragment
1651
+ if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
1652
+ var nodeChildElements = nodeChildNodes.filter(isElementNode);
1653
+ // If `node` has more than one element child or has a Text node child.
1654
+ if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {
1655
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');
1656
+ }
1657
+ // Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`.
1658
+ if (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {
1659
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');
1660
+ }
1661
+ }
1662
+ // Element
1663
+ if (isElementNode(node)) {
1664
+ // `parent` has an element child that is not `child` or a doctype is following `child`.
1665
+ if (!isElementReplacementPossible(parent, child)) {
1666
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');
1667
+ }
1668
+ }
1669
+ // DocumentType
1670
+ if (isDocTypeNode(node)) {
1671
+ function hasDoctypeChildThatIsNotChild(node) {
1672
+ return isDocTypeNode(node) && node !== child;
1673
+ }
1674
+
1675
+ // `parent` has a doctype child that is not `child`,
1676
+ if (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {
1677
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');
1678
+ }
1679
+ var parentElementChild = find(parentChildNodes, isElementNode);
1680
+ // or an element is preceding `child`.
1681
+ if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
1682
+ throw new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');
1683
+ }
1684
+ }
1685
+ }
1686
+
984
1687
  /**
985
- * preformance key(refChild == null)
1688
+ * @private
1689
+ * @param {Node} parent the parent node to insert `node` into
1690
+ * @param {Node} node the node to insert
1691
+ * @param {Node=} child the node that should become the `nextSibling` of `node`
1692
+ * @returns {Node}
1693
+ * @throws DOMException for several node combinations that would create a DOM that is not well-formed.
1694
+ * @throws DOMException if `child` is provided but is not a child of `parent`.
1695
+ * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
986
1696
  */
987
- function _insertBefore(parentNode,newChild,nextChild){
988
- var cp = newChild.parentNode;
1697
+ function _insertBefore(parent, node, child, _inDocumentAssertion) {
1698
+ // To ensure pre-insertion validity of a node into a parent before a child, run these steps:
1699
+ assertPreInsertionValidity1to5(parent, node, child);
1700
+
1701
+ // If parent is a document, and any of the statements below, switched on the interface node implements,
1702
+ // are true, then throw a "HierarchyRequestError" DOMException.
1703
+ if (parent.nodeType === Node.DOCUMENT_NODE) {
1704
+ (_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);
1705
+ }
1706
+
1707
+ var cp = node.parentNode;
989
1708
  if(cp){
990
- cp.removeChild(newChild);//remove and update
1709
+ cp.removeChild(node);//remove and update
991
1710
  }
992
- if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
993
- var newFirst = newChild.firstChild;
1711
+ if(node.nodeType === DOCUMENT_FRAGMENT_NODE){
1712
+ var newFirst = node.firstChild;
994
1713
  if (newFirst == null) {
995
- return newChild;
1714
+ return node;
996
1715
  }
997
- var newLast = newChild.lastChild;
1716
+ var newLast = node.lastChild;
998
1717
  }else{
999
- newFirst = newLast = newChild;
1718
+ newFirst = newLast = node;
1000
1719
  }
1001
- var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;
1720
+ var pre = child ? child.previousSibling : parent.lastChild;
1002
1721
 
1003
1722
  newFirst.previousSibling = pre;
1004
- newLast.nextSibling = nextChild;
1005
-
1006
-
1723
+ newLast.nextSibling = child;
1724
+
1725
+
1007
1726
  if(pre){
1008
1727
  pre.nextSibling = newFirst;
1009
1728
  }else{
1010
- parentNode.firstChild = newFirst;
1729
+ parent.firstChild = newFirst;
1011
1730
  }
1012
- if(nextChild == null){
1013
- parentNode.lastChild = newLast;
1731
+ if(child == null){
1732
+ parent.lastChild = newLast;
1014
1733
  }else{
1015
- nextChild.previousSibling = newLast;
1734
+ child.previousSibling = newLast;
1016
1735
  }
1017
1736
  do{
1018
- newFirst.parentNode = parentNode;
1737
+ newFirst.parentNode = parent;
1019
1738
  }while(newFirst !== newLast && (newFirst= newFirst.nextSibling))
1020
- _onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);
1021
- //console.log(parentNode.lastChild.nextSibling == null)
1022
- if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {
1023
- newChild.firstChild = newChild.lastChild = null;
1739
+ _onUpdateChild(parent.ownerDocument||parent, parent);
1740
+ //console.log(parent.lastChild.nextSibling == null)
1741
+ if (node.nodeType == DOCUMENT_FRAGMENT_NODE) {
1742
+ node.firstChild = node.lastChild = null;
1024
1743
  }
1025
- return newChild;
1744
+ return node;
1026
1745
  }
1027
- function _appendSingleChild(parentNode,newChild){
1028
- var cp = newChild.parentNode;
1029
- if(cp){
1030
- var pre = parentNode.lastChild;
1031
- cp.removeChild(newChild);//remove and update
1032
- var pre = parentNode.lastChild;
1746
+
1747
+ /**
1748
+ * Appends `newChild` to `parentNode`.
1749
+ * If `newChild` is already connected to a `parentNode` it is first removed from it.
1750
+ *
1751
+ * @see https://github.com/xmldom/xmldom/issues/135
1752
+ * @see https://github.com/xmldom/xmldom/issues/145
1753
+ * @param {Node} parentNode
1754
+ * @param {Node} newChild
1755
+ * @returns {Node}
1756
+ * @private
1757
+ */
1758
+ function _appendSingleChild (parentNode, newChild) {
1759
+ if (newChild.parentNode) {
1760
+ newChild.parentNode.removeChild(newChild);
1033
1761
  }
1034
- var pre = parentNode.lastChild;
1035
1762
  newChild.parentNode = parentNode;
1036
- newChild.previousSibling = pre;
1763
+ newChild.previousSibling = parentNode.lastChild;
1037
1764
  newChild.nextSibling = null;
1038
- if(pre){
1039
- pre.nextSibling = newChild;
1040
- }else{
1765
+ if (newChild.previousSibling) {
1766
+ newChild.previousSibling.nextSibling = newChild;
1767
+ } else {
1041
1768
  parentNode.firstChild = newChild;
1042
1769
  }
1043
1770
  parentNode.lastChild = newChild;
1044
- _onUpdateChild(parentNode.ownerDocument,parentNode,newChild);
1771
+ _onUpdateChild(parentNode.ownerDocument, parentNode, newChild);
1045
1772
  return newChild;
1046
- //console.log("__aa",parentNode.lastChild.nextSibling == null)
1047
1773
  }
1774
+
1048
1775
  Document.prototype = {
1049
1776
  //implementation : null,
1050
1777
  nodeName : '#document',
1051
1778
  nodeType : DOCUMENT_NODE,
1779
+ /**
1780
+ * The DocumentType node of the document.
1781
+ *
1782
+ * @readonly
1783
+ * @type DocumentType
1784
+ */
1052
1785
  doctype : null,
1053
1786
  documentElement : null,
1054
1787
  _inc : 1,
1055
-
1056
- insertBefore : function(newChild, refChild){//raises
1788
+
1789
+ insertBefore : function(newChild, refChild){//raises
1057
1790
  if(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){
1058
1791
  var child = newChild.firstChild;
1059
1792
  while(child){
@@ -1063,11 +1796,13 @@ Document.prototype = {
1063
1796
  }
1064
1797
  return newChild;
1065
1798
  }
1066
- if(this.documentElement == null && newChild.nodeType == ELEMENT_NODE){
1799
+ _insertBefore(this, newChild, refChild);
1800
+ newChild.ownerDocument = this;
1801
+ if (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {
1067
1802
  this.documentElement = newChild;
1068
1803
  }
1069
-
1070
- return _insertBefore(this,newChild,refChild),(newChild.ownerDocument = this),newChild;
1804
+
1805
+ return newChild;
1071
1806
  },
1072
1807
  removeChild : function(oldChild){
1073
1808
  if(this.documentElement == oldChild){
@@ -1075,6 +1810,17 @@ Document.prototype = {
1075
1810
  }
1076
1811
  return _removeChild(this,oldChild);
1077
1812
  },
1813
+ replaceChild: function (newChild, oldChild) {
1814
+ //raises
1815
+ _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
1816
+ newChild.ownerDocument = this;
1817
+ if (oldChild) {
1818
+ this.removeChild(oldChild);
1819
+ }
1820
+ if (isElementNode(newChild)) {
1821
+ this.documentElement = newChild;
1822
+ }
1823
+ },
1078
1824
  // Introduced in DOM Level 2:
1079
1825
  importNode : function(importedNode,deep){
1080
1826
  return importNode(this,importedNode,deep);
@@ -1092,28 +1838,58 @@ Document.prototype = {
1092
1838
  })
1093
1839
  return rtv;
1094
1840
  },
1095
-
1096
- getElementsByClassName: function(className) {
1097
- var pattern = new RegExp("(^|\\s)" + className + "(\\s|$)");
1841
+
1842
+ /**
1843
+ * The `getElementsByClassName` method of `Document` interface returns an array-like object
1844
+ * of all child elements which have **all** of the given class name(s).
1845
+ *
1846
+ * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.
1847
+ *
1848
+ *
1849
+ * Warning: This is a live LiveNodeList.
1850
+ * Changes in the DOM will reflect in the array as the changes occur.
1851
+ * If an element selected by this array no longer qualifies for the selector,
1852
+ * it will automatically be removed. Be aware of this for iteration purposes.
1853
+ *
1854
+ * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace
1855
+ *
1856
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
1857
+ * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname
1858
+ */
1859
+ getElementsByClassName: function(classNames) {
1860
+ var classNamesSet = toOrderedSet(classNames)
1098
1861
  return new LiveNodeList(this, function(base) {
1099
1862
  var ls = [];
1100
- _visitNode(base.documentElement, function(node) {
1101
- if(node !== base && node.nodeType == ELEMENT_NODE) {
1102
- if(pattern.test(node.getAttribute('class'))) {
1103
- ls.push(node);
1863
+ if (classNamesSet.length > 0) {
1864
+ _visitNode(base.documentElement, function(node) {
1865
+ if(node !== base && node.nodeType === ELEMENT_NODE) {
1866
+ var nodeClassNames = node.getAttribute('class')
1867
+ // can be null if the attribute does not exist
1868
+ if (nodeClassNames) {
1869
+ // before splitting and iterating just compare them for the most common case
1870
+ var matches = classNames === nodeClassNames;
1871
+ if (!matches) {
1872
+ var nodeClassNamesSet = toOrderedSet(nodeClassNames)
1873
+ matches = classNamesSet.every(arrayIncludes(nodeClassNamesSet))
1874
+ }
1875
+ if(matches) {
1876
+ ls.push(node);
1877
+ }
1878
+ }
1104
1879
  }
1105
- }
1106
- });
1880
+ });
1881
+ }
1107
1882
  return ls;
1108
1883
  });
1109
1884
  },
1110
-
1885
+
1111
1886
  //document factory method:
1112
1887
  createElement : function(tagName){
1113
1888
  var node = new Element();
1114
1889
  node.ownerDocument = this;
1115
1890
  node.nodeName = tagName;
1116
1891
  node.tagName = tagName;
1892
+ node.localName = tagName;
1117
1893
  node.childNodes = new NodeList();
1118
1894
  var attrs = node.attributes = new NamedNodeMap();
1119
1895
  attrs._ownerElement = node;
@@ -1231,7 +2007,7 @@ Element.prototype = {
1231
2007
  var attr = this.getAttributeNode(name)
1232
2008
  attr && this.removeAttributeNode(attr);
1233
2009
  },
1234
-
2010
+
1235
2011
  //four real opeartion method
1236
2012
  appendChild:function(newChild){
1237
2013
  if(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){
@@ -1255,7 +2031,7 @@ Element.prototype = {
1255
2031
  var old = this.getAttributeNodeNS(namespaceURI, localName);
1256
2032
  old && this.removeAttributeNode(old);
1257
2033
  },
1258
-
2034
+
1259
2035
  hasAttributeNS : function(namespaceURI, localName){
1260
2036
  return this.getAttributeNodeNS(namespaceURI, localName)!=null;
1261
2037
  },
@@ -1271,7 +2047,7 @@ Element.prototype = {
1271
2047
  getAttributeNodeNS : function(namespaceURI, localName){
1272
2048
  return this.attributes.getNamedItemNS(namespaceURI, localName);
1273
2049
  },
1274
-
2050
+
1275
2051
  getElementsByTagName : function(tagName){
1276
2052
  return new LiveNodeList(this,function(base){
1277
2053
  var ls = [];
@@ -1292,7 +2068,7 @@ Element.prototype = {
1292
2068
  }
1293
2069
  });
1294
2070
  return ls;
1295
-
2071
+
1296
2072
  });
1297
2073
  }
1298
2074
  };
@@ -1321,7 +2097,7 @@ CharacterData.prototype = {
1321
2097
  },
1322
2098
  insertData: function(offset,text) {
1323
2099
  this.replaceData(offset,0,text);
1324
-
2100
+
1325
2101
  },
1326
2102
  appendChild:function(newChild){
1327
2103
  throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])
@@ -1415,7 +2191,7 @@ function nodeSerializeToString(isHtml,nodeFilter){
1415
2191
  var refNode = this.nodeType == 9 && this.documentElement || this;
1416
2192
  var prefix = refNode.prefix;
1417
2193
  var uri = refNode.namespaceURI;
1418
-
2194
+
1419
2195
  if(uri && prefix == null){
1420
2196
  //console.log(prefix)
1421
2197
  var prefix = refNode.lookupPrefix(uri);
@@ -1431,36 +2207,56 @@ function nodeSerializeToString(isHtml,nodeFilter){
1431
2207
  //console.log('###',this.nodeType,uri,prefix,buf.join(''))
1432
2208
  return buf.join('');
1433
2209
  }
1434
- function needNamespaceDefine(node,isHTML, visibleNamespaces) {
1435
- var prefix = node.prefix||'';
2210
+
2211
+ function needNamespaceDefine(node, isHTML, visibleNamespaces) {
2212
+ var prefix = node.prefix || '';
1436
2213
  var uri = node.namespaceURI;
1437
- if (!prefix && !uri){
2214
+ // According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,
2215
+ // and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :
2216
+ // > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.
2217
+ // in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)
2218
+ // and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :
2219
+ // > [...] Furthermore, the attribute value [...] must not be an empty string.
2220
+ // so serializing empty namespace value like xmlns:ds="" would produce an invalid XML document.
2221
+ if (!uri) {
1438
2222
  return false;
1439
2223
  }
1440
- if (prefix === "xml" && uri === "http://www.w3.org/XML/1998/namespace"
1441
- || uri == 'http://www.w3.org/2000/xmlns/'){
2224
+ if (prefix === "xml" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) {
1442
2225
  return false;
1443
2226
  }
1444
-
1445
- var i = visibleNamespaces.length
1446
- //console.log('@@@@',node.tagName,prefix,uri,visibleNamespaces)
2227
+
2228
+ var i = visibleNamespaces.length
1447
2229
  while (i--) {
1448
2230
  var ns = visibleNamespaces[i];
1449
2231
  // get namespace prefix
1450
- //console.log(node.nodeType,node.tagName,ns.prefix,prefix)
1451
- if (ns.prefix == prefix){
1452
- return ns.namespace != uri;
2232
+ if (ns.prefix === prefix) {
2233
+ return ns.namespace !== uri;
1453
2234
  }
1454
2235
  }
1455
- //console.log(isHTML,uri,prefix=='')
1456
- //if(isHTML && prefix ==null && uri == 'http://www.w3.org/1999/xhtml'){
1457
- // return false;
1458
- //}
1459
- //node.flag = '11111'
1460
- //console.error(3,true,node.flag,node.prefix,node.namespaceURI)
1461
2236
  return true;
1462
2237
  }
2238
+ /**
2239
+ * Well-formed constraint: No < in Attribute Values
2240
+ * > The replacement text of any entity referred to directly or indirectly
2241
+ * > in an attribute value must not contain a <.
2242
+ * @see https://www.w3.org/TR/xml11/#CleanAttrVals
2243
+ * @see https://www.w3.org/TR/xml11/#NT-AttValue
2244
+ *
2245
+ * Literal whitespace other than space that appear in attribute values
2246
+ * are serialized as their entity references, so they will be preserved.
2247
+ * (In contrast to whitespace literals in the input which are normalized to spaces)
2248
+ * @see https://www.w3.org/TR/xml11/#AVNormalize
2249
+ * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes
2250
+ */
2251
+ function addSerializedAttribute(buf, qualifiedName, value) {
2252
+ buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"')
2253
+ }
2254
+
1463
2255
  function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
2256
+ if (!visibleNamespaces) {
2257
+ visibleNamespaces = [];
2258
+ }
2259
+
1464
2260
  if(nodeFilter){
1465
2261
  node = nodeFilter(node);
1466
2262
  if(node){
@@ -1473,20 +2269,51 @@ function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
1473
2269
  }
1474
2270
  //buf.sort.apply(attrs, attributeSorter);
1475
2271
  }
2272
+
1476
2273
  switch(node.nodeType){
1477
2274
  case ELEMENT_NODE:
1478
- if (!visibleNamespaces) visibleNamespaces = [];
1479
- var startVisibleNamespaces = visibleNamespaces.length;
1480
2275
  var attrs = node.attributes;
1481
2276
  var len = attrs.length;
1482
2277
  var child = node.firstChild;
1483
2278
  var nodeName = node.tagName;
1484
-
1485
- isHTML = (htmlns === node.namespaceURI) ||isHTML
1486
- buf.push('<',nodeName);
1487
-
1488
-
1489
-
2279
+
2280
+ isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML
2281
+
2282
+ var prefixedNodeName = nodeName
2283
+ if (!isHTML && !node.prefix && node.namespaceURI) {
2284
+ var defaultNS
2285
+ // lookup current default ns from `xmlns` attribute
2286
+ for (var ai = 0; ai < attrs.length; ai++) {
2287
+ if (attrs.item(ai).name === 'xmlns') {
2288
+ defaultNS = attrs.item(ai).value
2289
+ break
2290
+ }
2291
+ }
2292
+ if (!defaultNS) {
2293
+ // lookup current default ns in visibleNamespaces
2294
+ for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
2295
+ var namespace = visibleNamespaces[nsi]
2296
+ if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
2297
+ defaultNS = namespace.namespace
2298
+ break
2299
+ }
2300
+ }
2301
+ }
2302
+ if (defaultNS !== node.namespaceURI) {
2303
+ for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
2304
+ var namespace = visibleNamespaces[nsi]
2305
+ if (namespace.namespace === node.namespaceURI) {
2306
+ if (namespace.prefix) {
2307
+ prefixedNodeName = namespace.prefix + ':' + nodeName
2308
+ }
2309
+ break
2310
+ }
2311
+ }
2312
+ }
2313
+ }
2314
+
2315
+ buf.push('<', prefixedNodeName);
2316
+
1490
2317
  for(var i=0;i<len;i++){
1491
2318
  // add namespaces for attributes
1492
2319
  var attr = attrs.item(i);
@@ -1496,30 +2323,26 @@ function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
1496
2323
  visibleNamespaces.push({ prefix: '', namespace: attr.value });
1497
2324
  }
1498
2325
  }
2326
+
1499
2327
  for(var i=0;i<len;i++){
1500
2328
  var attr = attrs.item(i);
1501
2329
  if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
1502
2330
  var prefix = attr.prefix||'';
1503
2331
  var uri = attr.namespaceURI;
1504
- var ns = prefix ? ' xmlns:' + prefix : " xmlns";
1505
- buf.push(ns, '="' , uri , '"');
2332
+ addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
1506
2333
  visibleNamespaces.push({ prefix: prefix, namespace:uri });
1507
2334
  }
1508
2335
  serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
1509
2336
  }
1510
- // add namespace for current node
1511
- if (needNamespaceDefine(node,isHTML, visibleNamespaces)) {
2337
+
2338
+ // add namespace for current node
2339
+ if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
1512
2340
  var prefix = node.prefix||'';
1513
2341
  var uri = node.namespaceURI;
1514
- if (uri) {
1515
- // Avoid empty namespace value like xmlns:ds=""
1516
- // Empty namespace URL will we produce an invalid XML document
1517
- var ns = prefix ? ' xmlns:' + prefix : " xmlns";
1518
- buf.push(ns, '="' , uri , '"');
1519
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
1520
- }
2342
+ addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
2343
+ visibleNamespaces.push({ prefix: prefix, namespace:uri });
1521
2344
  }
1522
-
2345
+
1523
2346
  if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
1524
2347
  buf.push('>');
1525
2348
  //if is cdata child node
@@ -1528,18 +2351,18 @@ function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
1528
2351
  if(child.data){
1529
2352
  buf.push(child.data);
1530
2353
  }else{
1531
- serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
2354
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
1532
2355
  }
1533
2356
  child = child.nextSibling;
1534
2357
  }
1535
2358
  }else
1536
2359
  {
1537
2360
  while(child){
1538
- serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
2361
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
1539
2362
  child = child.nextSibling;
1540
2363
  }
1541
2364
  }
1542
- buf.push('</',nodeName,'>');
2365
+ buf.push('</',prefixedNodeName,'>');
1543
2366
  }else{
1544
2367
  buf.push('/>');
1545
2368
  }
@@ -1550,18 +2373,12 @@ function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
1550
2373
  case DOCUMENT_FRAGMENT_NODE:
1551
2374
  var child = node.firstChild;
1552
2375
  while(child){
1553
- serializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);
2376
+ serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
1554
2377
  child = child.nextSibling;
1555
2378
  }
1556
2379
  return;
1557
2380
  case ATTRIBUTE_NODE:
1558
- /**
1559
- * Well-formedness constraint: No < in Attribute Values
1560
- * The replacement text of any entity referred to directly or indirectly in an attribute value must not contain a <.
1561
- * @see https://www.w3.org/TR/xml/#CleanAttrVals
1562
- * @see https://www.w3.org/TR/xml/#NT-AttValue
1563
- */
1564
- return buf.push(' ', node.name, '="', node.value.replace(/[<&"]/g,_xmlEncoder), '"');
2381
+ return addSerializedAttribute(buf, node.name, node.value);
1565
2382
  case TEXT_NODE:
1566
2383
  /**
1567
2384
  * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
@@ -1577,10 +2394,10 @@ function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
1577
2394
  * and does not include the CDATA-section-close delimiter, `]]>`.
1578
2395
  *
1579
2396
  * @see https://www.w3.org/TR/xml/#NT-CharData
2397
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
1580
2398
  */
1581
2399
  return buf.push(node.data
1582
- .replace(/[<&]/g,_xmlEncoder)
1583
- .replace(/]]>/g, ']]&gt;')
2400
+ .replace(/[<&>]/g,_xmlEncoder)
1584
2401
  );
1585
2402
  case CDATA_SECTION_NODE:
1586
2403
  return buf.push( '<![CDATA[',node.data,']]>');
@@ -1666,11 +2483,13 @@ function importNode(doc,node,deep){
1666
2483
  // attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
1667
2484
  function cloneNode(doc,node,deep){
1668
2485
  var node2 = new node.constructor();
1669
- for(var n in node){
1670
- var v = node[n];
1671
- if(typeof v != 'object' ){
1672
- if(v != node2[n]){
1673
- node2[n] = v;
2486
+ for (var n in node) {
2487
+ if (Object.prototype.hasOwnProperty.call(node, n)) {
2488
+ var v = node[n];
2489
+ if (typeof v != "object") {
2490
+ if (v != node2[n]) {
2491
+ node2[n] = v;
2492
+ }
1674
2493
  }
1675
2494
  }
1676
2495
  }
@@ -1713,10 +2532,12 @@ try{
1713
2532
  return this.$$length;
1714
2533
  }
1715
2534
  });
2535
+
1716
2536
  Object.defineProperty(Node.prototype,'textContent',{
1717
2537
  get:function(){
1718
2538
  return getTextContent(this);
1719
2539
  },
2540
+
1720
2541
  set:function(data){
1721
2542
  switch(this.nodeType){
1722
2543
  case ELEMENT_NODE:
@@ -1728,15 +2549,15 @@ try{
1728
2549
  this.appendChild(this.ownerDocument.createTextNode(data));
1729
2550
  }
1730
2551
  break;
2552
+
1731
2553
  default:
1732
- //TODO:
1733
2554
  this.data = data;
1734
2555
  this.value = data;
1735
2556
  this.nodeValue = data;
1736
2557
  }
1737
2558
  }
1738
2559
  })
1739
-
2560
+
1740
2561
  function getTextContent(node){
1741
2562
  switch(node.nodeType){
1742
2563
  case ELEMENT_NODE:
@@ -1754,6 +2575,7 @@ try{
1754
2575
  return node.nodeValue;
1755
2576
  }
1756
2577
  }
2578
+
1757
2579
  __set__ = function(object,key,value){
1758
2580
  //console.log(value)
1759
2581
  object['$$'+key] = value
@@ -1763,258 +2585,2192 @@ try{
1763
2585
  }
1764
2586
 
1765
2587
  //if(typeof require == 'function'){
1766
- exports.Node = Node;
2588
+ exports.DocumentType = DocumentType;
1767
2589
  exports.DOMException = DOMException;
1768
2590
  exports.DOMImplementation = DOMImplementation;
2591
+ exports.Element = Element;
2592
+ exports.Node = Node;
2593
+ exports.NodeList = NodeList;
1769
2594
  exports.XMLSerializer = XMLSerializer;
1770
2595
  //}
1771
2596
 
1772
- },{}],4:[function(require,module,exports){
1773
- exports.entityMap = {
1774
- lt: '<',
1775
- gt: '>',
1776
- amp: '&',
1777
- quot: '"',
1778
- apos: "'",
1779
- Agrave: "À",
1780
- Aacute: "Á",
1781
- Acirc: "Â",
1782
- Atilde: "Ã",
1783
- Auml: "Ä",
1784
- Aring: "Å",
1785
- AElig: "Æ",
1786
- Ccedil: "Ç",
1787
- Egrave: "È",
1788
- Eacute: "É",
1789
- Ecirc: "Ê",
1790
- Euml: "Ë",
1791
- Igrave: "Ì",
1792
- Iacute: "Í",
1793
- Icirc: "Î",
1794
- Iuml: "Ï",
1795
- ETH: "Ð",
1796
- Ntilde: "Ñ",
1797
- Ograve: "Ò",
1798
- Oacute: "Ó",
1799
- Ocirc: "Ô",
1800
- Otilde: "Õ",
1801
- Ouml: "Ö",
1802
- Oslash: "Ø",
1803
- Ugrave: "Ù",
1804
- Uacute: "Ú",
1805
- Ucirc: "Û",
1806
- Uuml: "Ü",
1807
- Yacute: "Ý",
1808
- THORN: "Þ",
1809
- szlig: "ß",
1810
- agrave: "à",
1811
- aacute: "á",
1812
- acirc: "â",
1813
- atilde: "ã",
1814
- auml: "ä",
1815
- aring: "å",
1816
- aelig: "æ",
1817
- ccedil: "ç",
1818
- egrave: "è",
1819
- eacute: "é",
1820
- ecirc: "ê",
1821
- euml: "ë",
1822
- igrave: "ì",
1823
- iacute: "í",
1824
- icirc: "î",
1825
- iuml: "ï",
1826
- eth: "ð",
1827
- ntilde: "ñ",
1828
- ograve: "ò",
1829
- oacute: "ó",
1830
- ocirc: "ô",
1831
- otilde: "õ",
1832
- ouml: "ö",
1833
- oslash: "ø",
1834
- ugrave: "ù",
1835
- uacute: "ú",
1836
- ucirc: "û",
1837
- uuml: "ü",
1838
- yacute: "ý",
1839
- thorn: "þ",
1840
- yuml: "ÿ",
1841
- nbsp: "\u00a0",
1842
- iexcl: "¡",
1843
- cent: "¢",
1844
- pound: "£",
1845
- curren: "¤",
1846
- yen: "¥",
1847
- brvbar: "¦",
1848
- sect: "§",
1849
- uml: "¨",
1850
- copy: "©",
1851
- ordf: "ª",
1852
- laquo: "«",
1853
- not: "¬",
1854
- shy: "­­",
1855
- reg: "®",
1856
- macr: "¯",
1857
- deg: "°",
1858
- plusmn: "±",
1859
- sup2: "²",
1860
- sup3: "³",
1861
- acute: "´",
1862
- micro: "µ",
1863
- para: "¶",
1864
- middot: "·",
1865
- cedil: "¸",
1866
- sup1: "¹",
1867
- ordm: "º",
1868
- raquo: "»",
1869
- frac14: "¼",
1870
- frac12: "½",
1871
- frac34: "¾",
1872
- iquest: "¿",
1873
- times: "×",
1874
- divide: "÷",
1875
- forall: "∀",
1876
- part: "∂",
1877
- exist: "∃",
1878
- empty: "∅",
1879
- nabla: "∇",
1880
- isin: "∈",
1881
- notin: "∉",
1882
- ni: "∋",
1883
- prod: "∏",
1884
- sum: "∑",
1885
- minus: "−",
1886
- lowast: "∗",
1887
- radic: "√",
1888
- prop: "∝",
1889
- infin: "∞",
1890
- ang: "∠",
1891
- and: "∧",
1892
- or: "∨",
1893
- cap: "∩",
1894
- cup: "∪",
1895
- 'int': "∫",
1896
- there4: "∴",
1897
- sim: "∼",
1898
- cong: "≅",
1899
- asymp: "≈",
1900
- ne: "≠",
1901
- equiv: "≡",
1902
- le: "≤",
1903
- ge: "≥",
1904
- sub: "⊂",
1905
- sup: "⊃",
1906
- nsub: "⊄",
1907
- sube: "⊆",
1908
- supe: "⊇",
1909
- oplus: "⊕",
1910
- otimes: "⊗",
1911
- perp: "⊥",
1912
- sdot: "⋅",
1913
- Alpha: "Α",
1914
- Beta: "Β",
1915
- Gamma: "Γ",
1916
- Delta: "Δ",
1917
- Epsilon: "Ε",
1918
- Zeta: "Ζ",
1919
- Eta: "Η",
1920
- Theta: "Θ",
1921
- Iota: "Ι",
1922
- Kappa: "Κ",
1923
- Lambda: "Λ",
1924
- Mu: "Μ",
1925
- Nu: "Ν",
1926
- Xi: "Ξ",
1927
- Omicron: "Ο",
1928
- Pi: "Π",
1929
- Rho: "Ρ",
1930
- Sigma: "Σ",
1931
- Tau: "Τ",
1932
- Upsilon: "Υ",
1933
- Phi: "Φ",
1934
- Chi: "Χ",
1935
- Psi: "Ψ",
1936
- Omega: "Ω",
1937
- alpha: "α",
1938
- beta: "β",
1939
- gamma: "γ",
1940
- delta: "δ",
1941
- epsilon: "ε",
1942
- zeta: "ζ",
1943
- eta: "η",
1944
- theta: "θ",
1945
- iota: "ι",
1946
- kappa: "κ",
1947
- lambda: "λ",
1948
- mu: "μ",
1949
- nu: "ν",
1950
- xi: "ξ",
1951
- omicron: "ο",
1952
- pi: "π",
1953
- rho: "ρ",
1954
- sigmaf: "ς",
1955
- sigma: "σ",
1956
- tau: "τ",
1957
- upsilon: "υ",
1958
- phi: "φ",
1959
- chi: "χ",
1960
- psi: "ψ",
1961
- omega: "ω",
1962
- thetasym: "ϑ",
1963
- upsih: "ϒ",
1964
- piv: "ϖ",
1965
- OElig: "Œ",
1966
- oelig: "œ",
1967
- Scaron: "Š",
1968
- scaron: "š",
1969
- Yuml: "Ÿ",
1970
- fnof: "ƒ",
1971
- circ: "ˆ",
1972
- tilde: "˜",
1973
- ensp: " ",
1974
- emsp: " ",
1975
- thinsp: " ",
1976
- zwnj: "‌",
1977
- zwj: "‍",
1978
- lrm: "‎",
1979
- rlm: "‏",
1980
- ndash: "–",
1981
- mdash: "—",
1982
- lsquo: "‘",
1983
- rsquo: "’",
1984
- sbquo: "‚",
1985
- ldquo: "“",
1986
- rdquo: "”",
1987
- bdquo: "„",
1988
- dagger: "†",
1989
- Dagger: "‡",
1990
- bull: "•",
1991
- hellip: "…",
1992
- permil: "‰",
1993
- prime: "′",
1994
- Prime: "″",
1995
- lsaquo: "‹",
1996
- rsaquo: "›",
1997
- oline: "‾",
1998
- euro: "€",
1999
- trade: "™",
2000
- larr: "←",
2001
- uarr: "↑",
2002
- rarr: "→",
2003
- darr: "↓",
2004
- harr: "↔",
2005
- crarr: "↵",
2006
- lceil: "⌈",
2007
- rceil: "⌉",
2008
- lfloor: "⌊",
2009
- rfloor: "⌋",
2010
- loz: "◊",
2011
- spades: "♠",
2012
- clubs: "♣",
2013
- hearts: "♥",
2014
- diams: "♦"
2015
- };
2597
+ },{"./conventions":2}],5:[function(require,module,exports){
2598
+ 'use strict';
2599
+
2600
+ var freeze = require('./conventions').freeze;
2601
+
2602
+ /**
2603
+ * The entities that are predefined in every XML document.
2604
+ *
2605
+ * @see https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-predefined-ent W3C XML 1.1
2606
+ * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0
2607
+ * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia
2608
+ */
2609
+ exports.XML_ENTITIES = freeze({
2610
+ amp: '&',
2611
+ apos: "'",
2612
+ gt: '>',
2613
+ lt: '<',
2614
+ quot: '"',
2615
+ });
2616
+
2617
+ /**
2618
+ * A map of all entities that are detected in an HTML document.
2619
+ * They contain all entries from `XML_ENTITIES`.
2620
+ *
2621
+ * @see XML_ENTITIES
2622
+ * @see DOMParser.parseFromString
2623
+ * @see DOMImplementation.prototype.createHTMLDocument
2624
+ * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec
2625
+ * @see https://html.spec.whatwg.org/entities.json JSON
2626
+ * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names
2627
+ * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML
2628
+ * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)
2629
+ * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)
2630
+ */
2631
+ exports.HTML_ENTITIES = freeze({
2632
+ Aacute: '\u00C1',
2633
+ aacute: '\u00E1',
2634
+ Abreve: '\u0102',
2635
+ abreve: '\u0103',
2636
+ ac: '\u223E',
2637
+ acd: '\u223F',
2638
+ acE: '\u223E\u0333',
2639
+ Acirc: '\u00C2',
2640
+ acirc: '\u00E2',
2641
+ acute: '\u00B4',
2642
+ Acy: '\u0410',
2643
+ acy: '\u0430',
2644
+ AElig: '\u00C6',
2645
+ aelig: '\u00E6',
2646
+ af: '\u2061',
2647
+ Afr: '\uD835\uDD04',
2648
+ afr: '\uD835\uDD1E',
2649
+ Agrave: '\u00C0',
2650
+ agrave: '\u00E0',
2651
+ alefsym: '\u2135',
2652
+ aleph: '\u2135',
2653
+ Alpha: '\u0391',
2654
+ alpha: '\u03B1',
2655
+ Amacr: '\u0100',
2656
+ amacr: '\u0101',
2657
+ amalg: '\u2A3F',
2658
+ AMP: '\u0026',
2659
+ amp: '\u0026',
2660
+ And: '\u2A53',
2661
+ and: '\u2227',
2662
+ andand: '\u2A55',
2663
+ andd: '\u2A5C',
2664
+ andslope: '\u2A58',
2665
+ andv: '\u2A5A',
2666
+ ang: '\u2220',
2667
+ ange: '\u29A4',
2668
+ angle: '\u2220',
2669
+ angmsd: '\u2221',
2670
+ angmsdaa: '\u29A8',
2671
+ angmsdab: '\u29A9',
2672
+ angmsdac: '\u29AA',
2673
+ angmsdad: '\u29AB',
2674
+ angmsdae: '\u29AC',
2675
+ angmsdaf: '\u29AD',
2676
+ angmsdag: '\u29AE',
2677
+ angmsdah: '\u29AF',
2678
+ angrt: '\u221F',
2679
+ angrtvb: '\u22BE',
2680
+ angrtvbd: '\u299D',
2681
+ angsph: '\u2222',
2682
+ angst: '\u00C5',
2683
+ angzarr: '\u237C',
2684
+ Aogon: '\u0104',
2685
+ aogon: '\u0105',
2686
+ Aopf: '\uD835\uDD38',
2687
+ aopf: '\uD835\uDD52',
2688
+ ap: '\u2248',
2689
+ apacir: '\u2A6F',
2690
+ apE: '\u2A70',
2691
+ ape: '\u224A',
2692
+ apid: '\u224B',
2693
+ apos: '\u0027',
2694
+ ApplyFunction: '\u2061',
2695
+ approx: '\u2248',
2696
+ approxeq: '\u224A',
2697
+ Aring: '\u00C5',
2698
+ aring: '\u00E5',
2699
+ Ascr: '\uD835\uDC9C',
2700
+ ascr: '\uD835\uDCB6',
2701
+ Assign: '\u2254',
2702
+ ast: '\u002A',
2703
+ asymp: '\u2248',
2704
+ asympeq: '\u224D',
2705
+ Atilde: '\u00C3',
2706
+ atilde: '\u00E3',
2707
+ Auml: '\u00C4',
2708
+ auml: '\u00E4',
2709
+ awconint: '\u2233',
2710
+ awint: '\u2A11',
2711
+ backcong: '\u224C',
2712
+ backepsilon: '\u03F6',
2713
+ backprime: '\u2035',
2714
+ backsim: '\u223D',
2715
+ backsimeq: '\u22CD',
2716
+ Backslash: '\u2216',
2717
+ Barv: '\u2AE7',
2718
+ barvee: '\u22BD',
2719
+ Barwed: '\u2306',
2720
+ barwed: '\u2305',
2721
+ barwedge: '\u2305',
2722
+ bbrk: '\u23B5',
2723
+ bbrktbrk: '\u23B6',
2724
+ bcong: '\u224C',
2725
+ Bcy: '\u0411',
2726
+ bcy: '\u0431',
2727
+ bdquo: '\u201E',
2728
+ becaus: '\u2235',
2729
+ Because: '\u2235',
2730
+ because: '\u2235',
2731
+ bemptyv: '\u29B0',
2732
+ bepsi: '\u03F6',
2733
+ bernou: '\u212C',
2734
+ Bernoullis: '\u212C',
2735
+ Beta: '\u0392',
2736
+ beta: '\u03B2',
2737
+ beth: '\u2136',
2738
+ between: '\u226C',
2739
+ Bfr: '\uD835\uDD05',
2740
+ bfr: '\uD835\uDD1F',
2741
+ bigcap: '\u22C2',
2742
+ bigcirc: '\u25EF',
2743
+ bigcup: '\u22C3',
2744
+ bigodot: '\u2A00',
2745
+ bigoplus: '\u2A01',
2746
+ bigotimes: '\u2A02',
2747
+ bigsqcup: '\u2A06',
2748
+ bigstar: '\u2605',
2749
+ bigtriangledown: '\u25BD',
2750
+ bigtriangleup: '\u25B3',
2751
+ biguplus: '\u2A04',
2752
+ bigvee: '\u22C1',
2753
+ bigwedge: '\u22C0',
2754
+ bkarow: '\u290D',
2755
+ blacklozenge: '\u29EB',
2756
+ blacksquare: '\u25AA',
2757
+ blacktriangle: '\u25B4',
2758
+ blacktriangledown: '\u25BE',
2759
+ blacktriangleleft: '\u25C2',
2760
+ blacktriangleright: '\u25B8',
2761
+ blank: '\u2423',
2762
+ blk12: '\u2592',
2763
+ blk14: '\u2591',
2764
+ blk34: '\u2593',
2765
+ block: '\u2588',
2766
+ bne: '\u003D\u20E5',
2767
+ bnequiv: '\u2261\u20E5',
2768
+ bNot: '\u2AED',
2769
+ bnot: '\u2310',
2770
+ Bopf: '\uD835\uDD39',
2771
+ bopf: '\uD835\uDD53',
2772
+ bot: '\u22A5',
2773
+ bottom: '\u22A5',
2774
+ bowtie: '\u22C8',
2775
+ boxbox: '\u29C9',
2776
+ boxDL: '\u2557',
2777
+ boxDl: '\u2556',
2778
+ boxdL: '\u2555',
2779
+ boxdl: '\u2510',
2780
+ boxDR: '\u2554',
2781
+ boxDr: '\u2553',
2782
+ boxdR: '\u2552',
2783
+ boxdr: '\u250C',
2784
+ boxH: '\u2550',
2785
+ boxh: '\u2500',
2786
+ boxHD: '\u2566',
2787
+ boxHd: '\u2564',
2788
+ boxhD: '\u2565',
2789
+ boxhd: '\u252C',
2790
+ boxHU: '\u2569',
2791
+ boxHu: '\u2567',
2792
+ boxhU: '\u2568',
2793
+ boxhu: '\u2534',
2794
+ boxminus: '\u229F',
2795
+ boxplus: '\u229E',
2796
+ boxtimes: '\u22A0',
2797
+ boxUL: '\u255D',
2798
+ boxUl: '\u255C',
2799
+ boxuL: '\u255B',
2800
+ boxul: '\u2518',
2801
+ boxUR: '\u255A',
2802
+ boxUr: '\u2559',
2803
+ boxuR: '\u2558',
2804
+ boxur: '\u2514',
2805
+ boxV: '\u2551',
2806
+ boxv: '\u2502',
2807
+ boxVH: '\u256C',
2808
+ boxVh: '\u256B',
2809
+ boxvH: '\u256A',
2810
+ boxvh: '\u253C',
2811
+ boxVL: '\u2563',
2812
+ boxVl: '\u2562',
2813
+ boxvL: '\u2561',
2814
+ boxvl: '\u2524',
2815
+ boxVR: '\u2560',
2816
+ boxVr: '\u255F',
2817
+ boxvR: '\u255E',
2818
+ boxvr: '\u251C',
2819
+ bprime: '\u2035',
2820
+ Breve: '\u02D8',
2821
+ breve: '\u02D8',
2822
+ brvbar: '\u00A6',
2823
+ Bscr: '\u212C',
2824
+ bscr: '\uD835\uDCB7',
2825
+ bsemi: '\u204F',
2826
+ bsim: '\u223D',
2827
+ bsime: '\u22CD',
2828
+ bsol: '\u005C',
2829
+ bsolb: '\u29C5',
2830
+ bsolhsub: '\u27C8',
2831
+ bull: '\u2022',
2832
+ bullet: '\u2022',
2833
+ bump: '\u224E',
2834
+ bumpE: '\u2AAE',
2835
+ bumpe: '\u224F',
2836
+ Bumpeq: '\u224E',
2837
+ bumpeq: '\u224F',
2838
+ Cacute: '\u0106',
2839
+ cacute: '\u0107',
2840
+ Cap: '\u22D2',
2841
+ cap: '\u2229',
2842
+ capand: '\u2A44',
2843
+ capbrcup: '\u2A49',
2844
+ capcap: '\u2A4B',
2845
+ capcup: '\u2A47',
2846
+ capdot: '\u2A40',
2847
+ CapitalDifferentialD: '\u2145',
2848
+ caps: '\u2229\uFE00',
2849
+ caret: '\u2041',
2850
+ caron: '\u02C7',
2851
+ Cayleys: '\u212D',
2852
+ ccaps: '\u2A4D',
2853
+ Ccaron: '\u010C',
2854
+ ccaron: '\u010D',
2855
+ Ccedil: '\u00C7',
2856
+ ccedil: '\u00E7',
2857
+ Ccirc: '\u0108',
2858
+ ccirc: '\u0109',
2859
+ Cconint: '\u2230',
2860
+ ccups: '\u2A4C',
2861
+ ccupssm: '\u2A50',
2862
+ Cdot: '\u010A',
2863
+ cdot: '\u010B',
2864
+ cedil: '\u00B8',
2865
+ Cedilla: '\u00B8',
2866
+ cemptyv: '\u29B2',
2867
+ cent: '\u00A2',
2868
+ CenterDot: '\u00B7',
2869
+ centerdot: '\u00B7',
2870
+ Cfr: '\u212D',
2871
+ cfr: '\uD835\uDD20',
2872
+ CHcy: '\u0427',
2873
+ chcy: '\u0447',
2874
+ check: '\u2713',
2875
+ checkmark: '\u2713',
2876
+ Chi: '\u03A7',
2877
+ chi: '\u03C7',
2878
+ cir: '\u25CB',
2879
+ circ: '\u02C6',
2880
+ circeq: '\u2257',
2881
+ circlearrowleft: '\u21BA',
2882
+ circlearrowright: '\u21BB',
2883
+ circledast: '\u229B',
2884
+ circledcirc: '\u229A',
2885
+ circleddash: '\u229D',
2886
+ CircleDot: '\u2299',
2887
+ circledR: '\u00AE',
2888
+ circledS: '\u24C8',
2889
+ CircleMinus: '\u2296',
2890
+ CirclePlus: '\u2295',
2891
+ CircleTimes: '\u2297',
2892
+ cirE: '\u29C3',
2893
+ cire: '\u2257',
2894
+ cirfnint: '\u2A10',
2895
+ cirmid: '\u2AEF',
2896
+ cirscir: '\u29C2',
2897
+ ClockwiseContourIntegral: '\u2232',
2898
+ CloseCurlyDoubleQuote: '\u201D',
2899
+ CloseCurlyQuote: '\u2019',
2900
+ clubs: '\u2663',
2901
+ clubsuit: '\u2663',
2902
+ Colon: '\u2237',
2903
+ colon: '\u003A',
2904
+ Colone: '\u2A74',
2905
+ colone: '\u2254',
2906
+ coloneq: '\u2254',
2907
+ comma: '\u002C',
2908
+ commat: '\u0040',
2909
+ comp: '\u2201',
2910
+ compfn: '\u2218',
2911
+ complement: '\u2201',
2912
+ complexes: '\u2102',
2913
+ cong: '\u2245',
2914
+ congdot: '\u2A6D',
2915
+ Congruent: '\u2261',
2916
+ Conint: '\u222F',
2917
+ conint: '\u222E',
2918
+ ContourIntegral: '\u222E',
2919
+ Copf: '\u2102',
2920
+ copf: '\uD835\uDD54',
2921
+ coprod: '\u2210',
2922
+ Coproduct: '\u2210',
2923
+ COPY: '\u00A9',
2924
+ copy: '\u00A9',
2925
+ copysr: '\u2117',
2926
+ CounterClockwiseContourIntegral: '\u2233',
2927
+ crarr: '\u21B5',
2928
+ Cross: '\u2A2F',
2929
+ cross: '\u2717',
2930
+ Cscr: '\uD835\uDC9E',
2931
+ cscr: '\uD835\uDCB8',
2932
+ csub: '\u2ACF',
2933
+ csube: '\u2AD1',
2934
+ csup: '\u2AD0',
2935
+ csupe: '\u2AD2',
2936
+ ctdot: '\u22EF',
2937
+ cudarrl: '\u2938',
2938
+ cudarrr: '\u2935',
2939
+ cuepr: '\u22DE',
2940
+ cuesc: '\u22DF',
2941
+ cularr: '\u21B6',
2942
+ cularrp: '\u293D',
2943
+ Cup: '\u22D3',
2944
+ cup: '\u222A',
2945
+ cupbrcap: '\u2A48',
2946
+ CupCap: '\u224D',
2947
+ cupcap: '\u2A46',
2948
+ cupcup: '\u2A4A',
2949
+ cupdot: '\u228D',
2950
+ cupor: '\u2A45',
2951
+ cups: '\u222A\uFE00',
2952
+ curarr: '\u21B7',
2953
+ curarrm: '\u293C',
2954
+ curlyeqprec: '\u22DE',
2955
+ curlyeqsucc: '\u22DF',
2956
+ curlyvee: '\u22CE',
2957
+ curlywedge: '\u22CF',
2958
+ curren: '\u00A4',
2959
+ curvearrowleft: '\u21B6',
2960
+ curvearrowright: '\u21B7',
2961
+ cuvee: '\u22CE',
2962
+ cuwed: '\u22CF',
2963
+ cwconint: '\u2232',
2964
+ cwint: '\u2231',
2965
+ cylcty: '\u232D',
2966
+ Dagger: '\u2021',
2967
+ dagger: '\u2020',
2968
+ daleth: '\u2138',
2969
+ Darr: '\u21A1',
2970
+ dArr: '\u21D3',
2971
+ darr: '\u2193',
2972
+ dash: '\u2010',
2973
+ Dashv: '\u2AE4',
2974
+ dashv: '\u22A3',
2975
+ dbkarow: '\u290F',
2976
+ dblac: '\u02DD',
2977
+ Dcaron: '\u010E',
2978
+ dcaron: '\u010F',
2979
+ Dcy: '\u0414',
2980
+ dcy: '\u0434',
2981
+ DD: '\u2145',
2982
+ dd: '\u2146',
2983
+ ddagger: '\u2021',
2984
+ ddarr: '\u21CA',
2985
+ DDotrahd: '\u2911',
2986
+ ddotseq: '\u2A77',
2987
+ deg: '\u00B0',
2988
+ Del: '\u2207',
2989
+ Delta: '\u0394',
2990
+ delta: '\u03B4',
2991
+ demptyv: '\u29B1',
2992
+ dfisht: '\u297F',
2993
+ Dfr: '\uD835\uDD07',
2994
+ dfr: '\uD835\uDD21',
2995
+ dHar: '\u2965',
2996
+ dharl: '\u21C3',
2997
+ dharr: '\u21C2',
2998
+ DiacriticalAcute: '\u00B4',
2999
+ DiacriticalDot: '\u02D9',
3000
+ DiacriticalDoubleAcute: '\u02DD',
3001
+ DiacriticalGrave: '\u0060',
3002
+ DiacriticalTilde: '\u02DC',
3003
+ diam: '\u22C4',
3004
+ Diamond: '\u22C4',
3005
+ diamond: '\u22C4',
3006
+ diamondsuit: '\u2666',
3007
+ diams: '\u2666',
3008
+ die: '\u00A8',
3009
+ DifferentialD: '\u2146',
3010
+ digamma: '\u03DD',
3011
+ disin: '\u22F2',
3012
+ div: '\u00F7',
3013
+ divide: '\u00F7',
3014
+ divideontimes: '\u22C7',
3015
+ divonx: '\u22C7',
3016
+ DJcy: '\u0402',
3017
+ djcy: '\u0452',
3018
+ dlcorn: '\u231E',
3019
+ dlcrop: '\u230D',
3020
+ dollar: '\u0024',
3021
+ Dopf: '\uD835\uDD3B',
3022
+ dopf: '\uD835\uDD55',
3023
+ Dot: '\u00A8',
3024
+ dot: '\u02D9',
3025
+ DotDot: '\u20DC',
3026
+ doteq: '\u2250',
3027
+ doteqdot: '\u2251',
3028
+ DotEqual: '\u2250',
3029
+ dotminus: '\u2238',
3030
+ dotplus: '\u2214',
3031
+ dotsquare: '\u22A1',
3032
+ doublebarwedge: '\u2306',
3033
+ DoubleContourIntegral: '\u222F',
3034
+ DoubleDot: '\u00A8',
3035
+ DoubleDownArrow: '\u21D3',
3036
+ DoubleLeftArrow: '\u21D0',
3037
+ DoubleLeftRightArrow: '\u21D4',
3038
+ DoubleLeftTee: '\u2AE4',
3039
+ DoubleLongLeftArrow: '\u27F8',
3040
+ DoubleLongLeftRightArrow: '\u27FA',
3041
+ DoubleLongRightArrow: '\u27F9',
3042
+ DoubleRightArrow: '\u21D2',
3043
+ DoubleRightTee: '\u22A8',
3044
+ DoubleUpArrow: '\u21D1',
3045
+ DoubleUpDownArrow: '\u21D5',
3046
+ DoubleVerticalBar: '\u2225',
3047
+ DownArrow: '\u2193',
3048
+ Downarrow: '\u21D3',
3049
+ downarrow: '\u2193',
3050
+ DownArrowBar: '\u2913',
3051
+ DownArrowUpArrow: '\u21F5',
3052
+ DownBreve: '\u0311',
3053
+ downdownarrows: '\u21CA',
3054
+ downharpoonleft: '\u21C3',
3055
+ downharpoonright: '\u21C2',
3056
+ DownLeftRightVector: '\u2950',
3057
+ DownLeftTeeVector: '\u295E',
3058
+ DownLeftVector: '\u21BD',
3059
+ DownLeftVectorBar: '\u2956',
3060
+ DownRightTeeVector: '\u295F',
3061
+ DownRightVector: '\u21C1',
3062
+ DownRightVectorBar: '\u2957',
3063
+ DownTee: '\u22A4',
3064
+ DownTeeArrow: '\u21A7',
3065
+ drbkarow: '\u2910',
3066
+ drcorn: '\u231F',
3067
+ drcrop: '\u230C',
3068
+ Dscr: '\uD835\uDC9F',
3069
+ dscr: '\uD835\uDCB9',
3070
+ DScy: '\u0405',
3071
+ dscy: '\u0455',
3072
+ dsol: '\u29F6',
3073
+ Dstrok: '\u0110',
3074
+ dstrok: '\u0111',
3075
+ dtdot: '\u22F1',
3076
+ dtri: '\u25BF',
3077
+ dtrif: '\u25BE',
3078
+ duarr: '\u21F5',
3079
+ duhar: '\u296F',
3080
+ dwangle: '\u29A6',
3081
+ DZcy: '\u040F',
3082
+ dzcy: '\u045F',
3083
+ dzigrarr: '\u27FF',
3084
+ Eacute: '\u00C9',
3085
+ eacute: '\u00E9',
3086
+ easter: '\u2A6E',
3087
+ Ecaron: '\u011A',
3088
+ ecaron: '\u011B',
3089
+ ecir: '\u2256',
3090
+ Ecirc: '\u00CA',
3091
+ ecirc: '\u00EA',
3092
+ ecolon: '\u2255',
3093
+ Ecy: '\u042D',
3094
+ ecy: '\u044D',
3095
+ eDDot: '\u2A77',
3096
+ Edot: '\u0116',
3097
+ eDot: '\u2251',
3098
+ edot: '\u0117',
3099
+ ee: '\u2147',
3100
+ efDot: '\u2252',
3101
+ Efr: '\uD835\uDD08',
3102
+ efr: '\uD835\uDD22',
3103
+ eg: '\u2A9A',
3104
+ Egrave: '\u00C8',
3105
+ egrave: '\u00E8',
3106
+ egs: '\u2A96',
3107
+ egsdot: '\u2A98',
3108
+ el: '\u2A99',
3109
+ Element: '\u2208',
3110
+ elinters: '\u23E7',
3111
+ ell: '\u2113',
3112
+ els: '\u2A95',
3113
+ elsdot: '\u2A97',
3114
+ Emacr: '\u0112',
3115
+ emacr: '\u0113',
3116
+ empty: '\u2205',
3117
+ emptyset: '\u2205',
3118
+ EmptySmallSquare: '\u25FB',
3119
+ emptyv: '\u2205',
3120
+ EmptyVerySmallSquare: '\u25AB',
3121
+ emsp: '\u2003',
3122
+ emsp13: '\u2004',
3123
+ emsp14: '\u2005',
3124
+ ENG: '\u014A',
3125
+ eng: '\u014B',
3126
+ ensp: '\u2002',
3127
+ Eogon: '\u0118',
3128
+ eogon: '\u0119',
3129
+ Eopf: '\uD835\uDD3C',
3130
+ eopf: '\uD835\uDD56',
3131
+ epar: '\u22D5',
3132
+ eparsl: '\u29E3',
3133
+ eplus: '\u2A71',
3134
+ epsi: '\u03B5',
3135
+ Epsilon: '\u0395',
3136
+ epsilon: '\u03B5',
3137
+ epsiv: '\u03F5',
3138
+ eqcirc: '\u2256',
3139
+ eqcolon: '\u2255',
3140
+ eqsim: '\u2242',
3141
+ eqslantgtr: '\u2A96',
3142
+ eqslantless: '\u2A95',
3143
+ Equal: '\u2A75',
3144
+ equals: '\u003D',
3145
+ EqualTilde: '\u2242',
3146
+ equest: '\u225F',
3147
+ Equilibrium: '\u21CC',
3148
+ equiv: '\u2261',
3149
+ equivDD: '\u2A78',
3150
+ eqvparsl: '\u29E5',
3151
+ erarr: '\u2971',
3152
+ erDot: '\u2253',
3153
+ Escr: '\u2130',
3154
+ escr: '\u212F',
3155
+ esdot: '\u2250',
3156
+ Esim: '\u2A73',
3157
+ esim: '\u2242',
3158
+ Eta: '\u0397',
3159
+ eta: '\u03B7',
3160
+ ETH: '\u00D0',
3161
+ eth: '\u00F0',
3162
+ Euml: '\u00CB',
3163
+ euml: '\u00EB',
3164
+ euro: '\u20AC',
3165
+ excl: '\u0021',
3166
+ exist: '\u2203',
3167
+ Exists: '\u2203',
3168
+ expectation: '\u2130',
3169
+ ExponentialE: '\u2147',
3170
+ exponentiale: '\u2147',
3171
+ fallingdotseq: '\u2252',
3172
+ Fcy: '\u0424',
3173
+ fcy: '\u0444',
3174
+ female: '\u2640',
3175
+ ffilig: '\uFB03',
3176
+ fflig: '\uFB00',
3177
+ ffllig: '\uFB04',
3178
+ Ffr: '\uD835\uDD09',
3179
+ ffr: '\uD835\uDD23',
3180
+ filig: '\uFB01',
3181
+ FilledSmallSquare: '\u25FC',
3182
+ FilledVerySmallSquare: '\u25AA',
3183
+ fjlig: '\u0066\u006A',
3184
+ flat: '\u266D',
3185
+ fllig: '\uFB02',
3186
+ fltns: '\u25B1',
3187
+ fnof: '\u0192',
3188
+ Fopf: '\uD835\uDD3D',
3189
+ fopf: '\uD835\uDD57',
3190
+ ForAll: '\u2200',
3191
+ forall: '\u2200',
3192
+ fork: '\u22D4',
3193
+ forkv: '\u2AD9',
3194
+ Fouriertrf: '\u2131',
3195
+ fpartint: '\u2A0D',
3196
+ frac12: '\u00BD',
3197
+ frac13: '\u2153',
3198
+ frac14: '\u00BC',
3199
+ frac15: '\u2155',
3200
+ frac16: '\u2159',
3201
+ frac18: '\u215B',
3202
+ frac23: '\u2154',
3203
+ frac25: '\u2156',
3204
+ frac34: '\u00BE',
3205
+ frac35: '\u2157',
3206
+ frac38: '\u215C',
3207
+ frac45: '\u2158',
3208
+ frac56: '\u215A',
3209
+ frac58: '\u215D',
3210
+ frac78: '\u215E',
3211
+ frasl: '\u2044',
3212
+ frown: '\u2322',
3213
+ Fscr: '\u2131',
3214
+ fscr: '\uD835\uDCBB',
3215
+ gacute: '\u01F5',
3216
+ Gamma: '\u0393',
3217
+ gamma: '\u03B3',
3218
+ Gammad: '\u03DC',
3219
+ gammad: '\u03DD',
3220
+ gap: '\u2A86',
3221
+ Gbreve: '\u011E',
3222
+ gbreve: '\u011F',
3223
+ Gcedil: '\u0122',
3224
+ Gcirc: '\u011C',
3225
+ gcirc: '\u011D',
3226
+ Gcy: '\u0413',
3227
+ gcy: '\u0433',
3228
+ Gdot: '\u0120',
3229
+ gdot: '\u0121',
3230
+ gE: '\u2267',
3231
+ ge: '\u2265',
3232
+ gEl: '\u2A8C',
3233
+ gel: '\u22DB',
3234
+ geq: '\u2265',
3235
+ geqq: '\u2267',
3236
+ geqslant: '\u2A7E',
3237
+ ges: '\u2A7E',
3238
+ gescc: '\u2AA9',
3239
+ gesdot: '\u2A80',
3240
+ gesdoto: '\u2A82',
3241
+ gesdotol: '\u2A84',
3242
+ gesl: '\u22DB\uFE00',
3243
+ gesles: '\u2A94',
3244
+ Gfr: '\uD835\uDD0A',
3245
+ gfr: '\uD835\uDD24',
3246
+ Gg: '\u22D9',
3247
+ gg: '\u226B',
3248
+ ggg: '\u22D9',
3249
+ gimel: '\u2137',
3250
+ GJcy: '\u0403',
3251
+ gjcy: '\u0453',
3252
+ gl: '\u2277',
3253
+ gla: '\u2AA5',
3254
+ glE: '\u2A92',
3255
+ glj: '\u2AA4',
3256
+ gnap: '\u2A8A',
3257
+ gnapprox: '\u2A8A',
3258
+ gnE: '\u2269',
3259
+ gne: '\u2A88',
3260
+ gneq: '\u2A88',
3261
+ gneqq: '\u2269',
3262
+ gnsim: '\u22E7',
3263
+ Gopf: '\uD835\uDD3E',
3264
+ gopf: '\uD835\uDD58',
3265
+ grave: '\u0060',
3266
+ GreaterEqual: '\u2265',
3267
+ GreaterEqualLess: '\u22DB',
3268
+ GreaterFullEqual: '\u2267',
3269
+ GreaterGreater: '\u2AA2',
3270
+ GreaterLess: '\u2277',
3271
+ GreaterSlantEqual: '\u2A7E',
3272
+ GreaterTilde: '\u2273',
3273
+ Gscr: '\uD835\uDCA2',
3274
+ gscr: '\u210A',
3275
+ gsim: '\u2273',
3276
+ gsime: '\u2A8E',
3277
+ gsiml: '\u2A90',
3278
+ Gt: '\u226B',
3279
+ GT: '\u003E',
3280
+ gt: '\u003E',
3281
+ gtcc: '\u2AA7',
3282
+ gtcir: '\u2A7A',
3283
+ gtdot: '\u22D7',
3284
+ gtlPar: '\u2995',
3285
+ gtquest: '\u2A7C',
3286
+ gtrapprox: '\u2A86',
3287
+ gtrarr: '\u2978',
3288
+ gtrdot: '\u22D7',
3289
+ gtreqless: '\u22DB',
3290
+ gtreqqless: '\u2A8C',
3291
+ gtrless: '\u2277',
3292
+ gtrsim: '\u2273',
3293
+ gvertneqq: '\u2269\uFE00',
3294
+ gvnE: '\u2269\uFE00',
3295
+ Hacek: '\u02C7',
3296
+ hairsp: '\u200A',
3297
+ half: '\u00BD',
3298
+ hamilt: '\u210B',
3299
+ HARDcy: '\u042A',
3300
+ hardcy: '\u044A',
3301
+ hArr: '\u21D4',
3302
+ harr: '\u2194',
3303
+ harrcir: '\u2948',
3304
+ harrw: '\u21AD',
3305
+ Hat: '\u005E',
3306
+ hbar: '\u210F',
3307
+ Hcirc: '\u0124',
3308
+ hcirc: '\u0125',
3309
+ hearts: '\u2665',
3310
+ heartsuit: '\u2665',
3311
+ hellip: '\u2026',
3312
+ hercon: '\u22B9',
3313
+ Hfr: '\u210C',
3314
+ hfr: '\uD835\uDD25',
3315
+ HilbertSpace: '\u210B',
3316
+ hksearow: '\u2925',
3317
+ hkswarow: '\u2926',
3318
+ hoarr: '\u21FF',
3319
+ homtht: '\u223B',
3320
+ hookleftarrow: '\u21A9',
3321
+ hookrightarrow: '\u21AA',
3322
+ Hopf: '\u210D',
3323
+ hopf: '\uD835\uDD59',
3324
+ horbar: '\u2015',
3325
+ HorizontalLine: '\u2500',
3326
+ Hscr: '\u210B',
3327
+ hscr: '\uD835\uDCBD',
3328
+ hslash: '\u210F',
3329
+ Hstrok: '\u0126',
3330
+ hstrok: '\u0127',
3331
+ HumpDownHump: '\u224E',
3332
+ HumpEqual: '\u224F',
3333
+ hybull: '\u2043',
3334
+ hyphen: '\u2010',
3335
+ Iacute: '\u00CD',
3336
+ iacute: '\u00ED',
3337
+ ic: '\u2063',
3338
+ Icirc: '\u00CE',
3339
+ icirc: '\u00EE',
3340
+ Icy: '\u0418',
3341
+ icy: '\u0438',
3342
+ Idot: '\u0130',
3343
+ IEcy: '\u0415',
3344
+ iecy: '\u0435',
3345
+ iexcl: '\u00A1',
3346
+ iff: '\u21D4',
3347
+ Ifr: '\u2111',
3348
+ ifr: '\uD835\uDD26',
3349
+ Igrave: '\u00CC',
3350
+ igrave: '\u00EC',
3351
+ ii: '\u2148',
3352
+ iiiint: '\u2A0C',
3353
+ iiint: '\u222D',
3354
+ iinfin: '\u29DC',
3355
+ iiota: '\u2129',
3356
+ IJlig: '\u0132',
3357
+ ijlig: '\u0133',
3358
+ Im: '\u2111',
3359
+ Imacr: '\u012A',
3360
+ imacr: '\u012B',
3361
+ image: '\u2111',
3362
+ ImaginaryI: '\u2148',
3363
+ imagline: '\u2110',
3364
+ imagpart: '\u2111',
3365
+ imath: '\u0131',
3366
+ imof: '\u22B7',
3367
+ imped: '\u01B5',
3368
+ Implies: '\u21D2',
3369
+ in: '\u2208',
3370
+ incare: '\u2105',
3371
+ infin: '\u221E',
3372
+ infintie: '\u29DD',
3373
+ inodot: '\u0131',
3374
+ Int: '\u222C',
3375
+ int: '\u222B',
3376
+ intcal: '\u22BA',
3377
+ integers: '\u2124',
3378
+ Integral: '\u222B',
3379
+ intercal: '\u22BA',
3380
+ Intersection: '\u22C2',
3381
+ intlarhk: '\u2A17',
3382
+ intprod: '\u2A3C',
3383
+ InvisibleComma: '\u2063',
3384
+ InvisibleTimes: '\u2062',
3385
+ IOcy: '\u0401',
3386
+ iocy: '\u0451',
3387
+ Iogon: '\u012E',
3388
+ iogon: '\u012F',
3389
+ Iopf: '\uD835\uDD40',
3390
+ iopf: '\uD835\uDD5A',
3391
+ Iota: '\u0399',
3392
+ iota: '\u03B9',
3393
+ iprod: '\u2A3C',
3394
+ iquest: '\u00BF',
3395
+ Iscr: '\u2110',
3396
+ iscr: '\uD835\uDCBE',
3397
+ isin: '\u2208',
3398
+ isindot: '\u22F5',
3399
+ isinE: '\u22F9',
3400
+ isins: '\u22F4',
3401
+ isinsv: '\u22F3',
3402
+ isinv: '\u2208',
3403
+ it: '\u2062',
3404
+ Itilde: '\u0128',
3405
+ itilde: '\u0129',
3406
+ Iukcy: '\u0406',
3407
+ iukcy: '\u0456',
3408
+ Iuml: '\u00CF',
3409
+ iuml: '\u00EF',
3410
+ Jcirc: '\u0134',
3411
+ jcirc: '\u0135',
3412
+ Jcy: '\u0419',
3413
+ jcy: '\u0439',
3414
+ Jfr: '\uD835\uDD0D',
3415
+ jfr: '\uD835\uDD27',
3416
+ jmath: '\u0237',
3417
+ Jopf: '\uD835\uDD41',
3418
+ jopf: '\uD835\uDD5B',
3419
+ Jscr: '\uD835\uDCA5',
3420
+ jscr: '\uD835\uDCBF',
3421
+ Jsercy: '\u0408',
3422
+ jsercy: '\u0458',
3423
+ Jukcy: '\u0404',
3424
+ jukcy: '\u0454',
3425
+ Kappa: '\u039A',
3426
+ kappa: '\u03BA',
3427
+ kappav: '\u03F0',
3428
+ Kcedil: '\u0136',
3429
+ kcedil: '\u0137',
3430
+ Kcy: '\u041A',
3431
+ kcy: '\u043A',
3432
+ Kfr: '\uD835\uDD0E',
3433
+ kfr: '\uD835\uDD28',
3434
+ kgreen: '\u0138',
3435
+ KHcy: '\u0425',
3436
+ khcy: '\u0445',
3437
+ KJcy: '\u040C',
3438
+ kjcy: '\u045C',
3439
+ Kopf: '\uD835\uDD42',
3440
+ kopf: '\uD835\uDD5C',
3441
+ Kscr: '\uD835\uDCA6',
3442
+ kscr: '\uD835\uDCC0',
3443
+ lAarr: '\u21DA',
3444
+ Lacute: '\u0139',
3445
+ lacute: '\u013A',
3446
+ laemptyv: '\u29B4',
3447
+ lagran: '\u2112',
3448
+ Lambda: '\u039B',
3449
+ lambda: '\u03BB',
3450
+ Lang: '\u27EA',
3451
+ lang: '\u27E8',
3452
+ langd: '\u2991',
3453
+ langle: '\u27E8',
3454
+ lap: '\u2A85',
3455
+ Laplacetrf: '\u2112',
3456
+ laquo: '\u00AB',
3457
+ Larr: '\u219E',
3458
+ lArr: '\u21D0',
3459
+ larr: '\u2190',
3460
+ larrb: '\u21E4',
3461
+ larrbfs: '\u291F',
3462
+ larrfs: '\u291D',
3463
+ larrhk: '\u21A9',
3464
+ larrlp: '\u21AB',
3465
+ larrpl: '\u2939',
3466
+ larrsim: '\u2973',
3467
+ larrtl: '\u21A2',
3468
+ lat: '\u2AAB',
3469
+ lAtail: '\u291B',
3470
+ latail: '\u2919',
3471
+ late: '\u2AAD',
3472
+ lates: '\u2AAD\uFE00',
3473
+ lBarr: '\u290E',
3474
+ lbarr: '\u290C',
3475
+ lbbrk: '\u2772',
3476
+ lbrace: '\u007B',
3477
+ lbrack: '\u005B',
3478
+ lbrke: '\u298B',
3479
+ lbrksld: '\u298F',
3480
+ lbrkslu: '\u298D',
3481
+ Lcaron: '\u013D',
3482
+ lcaron: '\u013E',
3483
+ Lcedil: '\u013B',
3484
+ lcedil: '\u013C',
3485
+ lceil: '\u2308',
3486
+ lcub: '\u007B',
3487
+ Lcy: '\u041B',
3488
+ lcy: '\u043B',
3489
+ ldca: '\u2936',
3490
+ ldquo: '\u201C',
3491
+ ldquor: '\u201E',
3492
+ ldrdhar: '\u2967',
3493
+ ldrushar: '\u294B',
3494
+ ldsh: '\u21B2',
3495
+ lE: '\u2266',
3496
+ le: '\u2264',
3497
+ LeftAngleBracket: '\u27E8',
3498
+ LeftArrow: '\u2190',
3499
+ Leftarrow: '\u21D0',
3500
+ leftarrow: '\u2190',
3501
+ LeftArrowBar: '\u21E4',
3502
+ LeftArrowRightArrow: '\u21C6',
3503
+ leftarrowtail: '\u21A2',
3504
+ LeftCeiling: '\u2308',
3505
+ LeftDoubleBracket: '\u27E6',
3506
+ LeftDownTeeVector: '\u2961',
3507
+ LeftDownVector: '\u21C3',
3508
+ LeftDownVectorBar: '\u2959',
3509
+ LeftFloor: '\u230A',
3510
+ leftharpoondown: '\u21BD',
3511
+ leftharpoonup: '\u21BC',
3512
+ leftleftarrows: '\u21C7',
3513
+ LeftRightArrow: '\u2194',
3514
+ Leftrightarrow: '\u21D4',
3515
+ leftrightarrow: '\u2194',
3516
+ leftrightarrows: '\u21C6',
3517
+ leftrightharpoons: '\u21CB',
3518
+ leftrightsquigarrow: '\u21AD',
3519
+ LeftRightVector: '\u294E',
3520
+ LeftTee: '\u22A3',
3521
+ LeftTeeArrow: '\u21A4',
3522
+ LeftTeeVector: '\u295A',
3523
+ leftthreetimes: '\u22CB',
3524
+ LeftTriangle: '\u22B2',
3525
+ LeftTriangleBar: '\u29CF',
3526
+ LeftTriangleEqual: '\u22B4',
3527
+ LeftUpDownVector: '\u2951',
3528
+ LeftUpTeeVector: '\u2960',
3529
+ LeftUpVector: '\u21BF',
3530
+ LeftUpVectorBar: '\u2958',
3531
+ LeftVector: '\u21BC',
3532
+ LeftVectorBar: '\u2952',
3533
+ lEg: '\u2A8B',
3534
+ leg: '\u22DA',
3535
+ leq: '\u2264',
3536
+ leqq: '\u2266',
3537
+ leqslant: '\u2A7D',
3538
+ les: '\u2A7D',
3539
+ lescc: '\u2AA8',
3540
+ lesdot: '\u2A7F',
3541
+ lesdoto: '\u2A81',
3542
+ lesdotor: '\u2A83',
3543
+ lesg: '\u22DA\uFE00',
3544
+ lesges: '\u2A93',
3545
+ lessapprox: '\u2A85',
3546
+ lessdot: '\u22D6',
3547
+ lesseqgtr: '\u22DA',
3548
+ lesseqqgtr: '\u2A8B',
3549
+ LessEqualGreater: '\u22DA',
3550
+ LessFullEqual: '\u2266',
3551
+ LessGreater: '\u2276',
3552
+ lessgtr: '\u2276',
3553
+ LessLess: '\u2AA1',
3554
+ lesssim: '\u2272',
3555
+ LessSlantEqual: '\u2A7D',
3556
+ LessTilde: '\u2272',
3557
+ lfisht: '\u297C',
3558
+ lfloor: '\u230A',
3559
+ Lfr: '\uD835\uDD0F',
3560
+ lfr: '\uD835\uDD29',
3561
+ lg: '\u2276',
3562
+ lgE: '\u2A91',
3563
+ lHar: '\u2962',
3564
+ lhard: '\u21BD',
3565
+ lharu: '\u21BC',
3566
+ lharul: '\u296A',
3567
+ lhblk: '\u2584',
3568
+ LJcy: '\u0409',
3569
+ ljcy: '\u0459',
3570
+ Ll: '\u22D8',
3571
+ ll: '\u226A',
3572
+ llarr: '\u21C7',
3573
+ llcorner: '\u231E',
3574
+ Lleftarrow: '\u21DA',
3575
+ llhard: '\u296B',
3576
+ lltri: '\u25FA',
3577
+ Lmidot: '\u013F',
3578
+ lmidot: '\u0140',
3579
+ lmoust: '\u23B0',
3580
+ lmoustache: '\u23B0',
3581
+ lnap: '\u2A89',
3582
+ lnapprox: '\u2A89',
3583
+ lnE: '\u2268',
3584
+ lne: '\u2A87',
3585
+ lneq: '\u2A87',
3586
+ lneqq: '\u2268',
3587
+ lnsim: '\u22E6',
3588
+ loang: '\u27EC',
3589
+ loarr: '\u21FD',
3590
+ lobrk: '\u27E6',
3591
+ LongLeftArrow: '\u27F5',
3592
+ Longleftarrow: '\u27F8',
3593
+ longleftarrow: '\u27F5',
3594
+ LongLeftRightArrow: '\u27F7',
3595
+ Longleftrightarrow: '\u27FA',
3596
+ longleftrightarrow: '\u27F7',
3597
+ longmapsto: '\u27FC',
3598
+ LongRightArrow: '\u27F6',
3599
+ Longrightarrow: '\u27F9',
3600
+ longrightarrow: '\u27F6',
3601
+ looparrowleft: '\u21AB',
3602
+ looparrowright: '\u21AC',
3603
+ lopar: '\u2985',
3604
+ Lopf: '\uD835\uDD43',
3605
+ lopf: '\uD835\uDD5D',
3606
+ loplus: '\u2A2D',
3607
+ lotimes: '\u2A34',
3608
+ lowast: '\u2217',
3609
+ lowbar: '\u005F',
3610
+ LowerLeftArrow: '\u2199',
3611
+ LowerRightArrow: '\u2198',
3612
+ loz: '\u25CA',
3613
+ lozenge: '\u25CA',
3614
+ lozf: '\u29EB',
3615
+ lpar: '\u0028',
3616
+ lparlt: '\u2993',
3617
+ lrarr: '\u21C6',
3618
+ lrcorner: '\u231F',
3619
+ lrhar: '\u21CB',
3620
+ lrhard: '\u296D',
3621
+ lrm: '\u200E',
3622
+ lrtri: '\u22BF',
3623
+ lsaquo: '\u2039',
3624
+ Lscr: '\u2112',
3625
+ lscr: '\uD835\uDCC1',
3626
+ Lsh: '\u21B0',
3627
+ lsh: '\u21B0',
3628
+ lsim: '\u2272',
3629
+ lsime: '\u2A8D',
3630
+ lsimg: '\u2A8F',
3631
+ lsqb: '\u005B',
3632
+ lsquo: '\u2018',
3633
+ lsquor: '\u201A',
3634
+ Lstrok: '\u0141',
3635
+ lstrok: '\u0142',
3636
+ Lt: '\u226A',
3637
+ LT: '\u003C',
3638
+ lt: '\u003C',
3639
+ ltcc: '\u2AA6',
3640
+ ltcir: '\u2A79',
3641
+ ltdot: '\u22D6',
3642
+ lthree: '\u22CB',
3643
+ ltimes: '\u22C9',
3644
+ ltlarr: '\u2976',
3645
+ ltquest: '\u2A7B',
3646
+ ltri: '\u25C3',
3647
+ ltrie: '\u22B4',
3648
+ ltrif: '\u25C2',
3649
+ ltrPar: '\u2996',
3650
+ lurdshar: '\u294A',
3651
+ luruhar: '\u2966',
3652
+ lvertneqq: '\u2268\uFE00',
3653
+ lvnE: '\u2268\uFE00',
3654
+ macr: '\u00AF',
3655
+ male: '\u2642',
3656
+ malt: '\u2720',
3657
+ maltese: '\u2720',
3658
+ Map: '\u2905',
3659
+ map: '\u21A6',
3660
+ mapsto: '\u21A6',
3661
+ mapstodown: '\u21A7',
3662
+ mapstoleft: '\u21A4',
3663
+ mapstoup: '\u21A5',
3664
+ marker: '\u25AE',
3665
+ mcomma: '\u2A29',
3666
+ Mcy: '\u041C',
3667
+ mcy: '\u043C',
3668
+ mdash: '\u2014',
3669
+ mDDot: '\u223A',
3670
+ measuredangle: '\u2221',
3671
+ MediumSpace: '\u205F',
3672
+ Mellintrf: '\u2133',
3673
+ Mfr: '\uD835\uDD10',
3674
+ mfr: '\uD835\uDD2A',
3675
+ mho: '\u2127',
3676
+ micro: '\u00B5',
3677
+ mid: '\u2223',
3678
+ midast: '\u002A',
3679
+ midcir: '\u2AF0',
3680
+ middot: '\u00B7',
3681
+ minus: '\u2212',
3682
+ minusb: '\u229F',
3683
+ minusd: '\u2238',
3684
+ minusdu: '\u2A2A',
3685
+ MinusPlus: '\u2213',
3686
+ mlcp: '\u2ADB',
3687
+ mldr: '\u2026',
3688
+ mnplus: '\u2213',
3689
+ models: '\u22A7',
3690
+ Mopf: '\uD835\uDD44',
3691
+ mopf: '\uD835\uDD5E',
3692
+ mp: '\u2213',
3693
+ Mscr: '\u2133',
3694
+ mscr: '\uD835\uDCC2',
3695
+ mstpos: '\u223E',
3696
+ Mu: '\u039C',
3697
+ mu: '\u03BC',
3698
+ multimap: '\u22B8',
3699
+ mumap: '\u22B8',
3700
+ nabla: '\u2207',
3701
+ Nacute: '\u0143',
3702
+ nacute: '\u0144',
3703
+ nang: '\u2220\u20D2',
3704
+ nap: '\u2249',
3705
+ napE: '\u2A70\u0338',
3706
+ napid: '\u224B\u0338',
3707
+ napos: '\u0149',
3708
+ napprox: '\u2249',
3709
+ natur: '\u266E',
3710
+ natural: '\u266E',
3711
+ naturals: '\u2115',
3712
+ nbsp: '\u00A0',
3713
+ nbump: '\u224E\u0338',
3714
+ nbumpe: '\u224F\u0338',
3715
+ ncap: '\u2A43',
3716
+ Ncaron: '\u0147',
3717
+ ncaron: '\u0148',
3718
+ Ncedil: '\u0145',
3719
+ ncedil: '\u0146',
3720
+ ncong: '\u2247',
3721
+ ncongdot: '\u2A6D\u0338',
3722
+ ncup: '\u2A42',
3723
+ Ncy: '\u041D',
3724
+ ncy: '\u043D',
3725
+ ndash: '\u2013',
3726
+ ne: '\u2260',
3727
+ nearhk: '\u2924',
3728
+ neArr: '\u21D7',
3729
+ nearr: '\u2197',
3730
+ nearrow: '\u2197',
3731
+ nedot: '\u2250\u0338',
3732
+ NegativeMediumSpace: '\u200B',
3733
+ NegativeThickSpace: '\u200B',
3734
+ NegativeThinSpace: '\u200B',
3735
+ NegativeVeryThinSpace: '\u200B',
3736
+ nequiv: '\u2262',
3737
+ nesear: '\u2928',
3738
+ nesim: '\u2242\u0338',
3739
+ NestedGreaterGreater: '\u226B',
3740
+ NestedLessLess: '\u226A',
3741
+ NewLine: '\u000A',
3742
+ nexist: '\u2204',
3743
+ nexists: '\u2204',
3744
+ Nfr: '\uD835\uDD11',
3745
+ nfr: '\uD835\uDD2B',
3746
+ ngE: '\u2267\u0338',
3747
+ nge: '\u2271',
3748
+ ngeq: '\u2271',
3749
+ ngeqq: '\u2267\u0338',
3750
+ ngeqslant: '\u2A7E\u0338',
3751
+ nges: '\u2A7E\u0338',
3752
+ nGg: '\u22D9\u0338',
3753
+ ngsim: '\u2275',
3754
+ nGt: '\u226B\u20D2',
3755
+ ngt: '\u226F',
3756
+ ngtr: '\u226F',
3757
+ nGtv: '\u226B\u0338',
3758
+ nhArr: '\u21CE',
3759
+ nharr: '\u21AE',
3760
+ nhpar: '\u2AF2',
3761
+ ni: '\u220B',
3762
+ nis: '\u22FC',
3763
+ nisd: '\u22FA',
3764
+ niv: '\u220B',
3765
+ NJcy: '\u040A',
3766
+ njcy: '\u045A',
3767
+ nlArr: '\u21CD',
3768
+ nlarr: '\u219A',
3769
+ nldr: '\u2025',
3770
+ nlE: '\u2266\u0338',
3771
+ nle: '\u2270',
3772
+ nLeftarrow: '\u21CD',
3773
+ nleftarrow: '\u219A',
3774
+ nLeftrightarrow: '\u21CE',
3775
+ nleftrightarrow: '\u21AE',
3776
+ nleq: '\u2270',
3777
+ nleqq: '\u2266\u0338',
3778
+ nleqslant: '\u2A7D\u0338',
3779
+ nles: '\u2A7D\u0338',
3780
+ nless: '\u226E',
3781
+ nLl: '\u22D8\u0338',
3782
+ nlsim: '\u2274',
3783
+ nLt: '\u226A\u20D2',
3784
+ nlt: '\u226E',
3785
+ nltri: '\u22EA',
3786
+ nltrie: '\u22EC',
3787
+ nLtv: '\u226A\u0338',
3788
+ nmid: '\u2224',
3789
+ NoBreak: '\u2060',
3790
+ NonBreakingSpace: '\u00A0',
3791
+ Nopf: '\u2115',
3792
+ nopf: '\uD835\uDD5F',
3793
+ Not: '\u2AEC',
3794
+ not: '\u00AC',
3795
+ NotCongruent: '\u2262',
3796
+ NotCupCap: '\u226D',
3797
+ NotDoubleVerticalBar: '\u2226',
3798
+ NotElement: '\u2209',
3799
+ NotEqual: '\u2260',
3800
+ NotEqualTilde: '\u2242\u0338',
3801
+ NotExists: '\u2204',
3802
+ NotGreater: '\u226F',
3803
+ NotGreaterEqual: '\u2271',
3804
+ NotGreaterFullEqual: '\u2267\u0338',
3805
+ NotGreaterGreater: '\u226B\u0338',
3806
+ NotGreaterLess: '\u2279',
3807
+ NotGreaterSlantEqual: '\u2A7E\u0338',
3808
+ NotGreaterTilde: '\u2275',
3809
+ NotHumpDownHump: '\u224E\u0338',
3810
+ NotHumpEqual: '\u224F\u0338',
3811
+ notin: '\u2209',
3812
+ notindot: '\u22F5\u0338',
3813
+ notinE: '\u22F9\u0338',
3814
+ notinva: '\u2209',
3815
+ notinvb: '\u22F7',
3816
+ notinvc: '\u22F6',
3817
+ NotLeftTriangle: '\u22EA',
3818
+ NotLeftTriangleBar: '\u29CF\u0338',
3819
+ NotLeftTriangleEqual: '\u22EC',
3820
+ NotLess: '\u226E',
3821
+ NotLessEqual: '\u2270',
3822
+ NotLessGreater: '\u2278',
3823
+ NotLessLess: '\u226A\u0338',
3824
+ NotLessSlantEqual: '\u2A7D\u0338',
3825
+ NotLessTilde: '\u2274',
3826
+ NotNestedGreaterGreater: '\u2AA2\u0338',
3827
+ NotNestedLessLess: '\u2AA1\u0338',
3828
+ notni: '\u220C',
3829
+ notniva: '\u220C',
3830
+ notnivb: '\u22FE',
3831
+ notnivc: '\u22FD',
3832
+ NotPrecedes: '\u2280',
3833
+ NotPrecedesEqual: '\u2AAF\u0338',
3834
+ NotPrecedesSlantEqual: '\u22E0',
3835
+ NotReverseElement: '\u220C',
3836
+ NotRightTriangle: '\u22EB',
3837
+ NotRightTriangleBar: '\u29D0\u0338',
3838
+ NotRightTriangleEqual: '\u22ED',
3839
+ NotSquareSubset: '\u228F\u0338',
3840
+ NotSquareSubsetEqual: '\u22E2',
3841
+ NotSquareSuperset: '\u2290\u0338',
3842
+ NotSquareSupersetEqual: '\u22E3',
3843
+ NotSubset: '\u2282\u20D2',
3844
+ NotSubsetEqual: '\u2288',
3845
+ NotSucceeds: '\u2281',
3846
+ NotSucceedsEqual: '\u2AB0\u0338',
3847
+ NotSucceedsSlantEqual: '\u22E1',
3848
+ NotSucceedsTilde: '\u227F\u0338',
3849
+ NotSuperset: '\u2283\u20D2',
3850
+ NotSupersetEqual: '\u2289',
3851
+ NotTilde: '\u2241',
3852
+ NotTildeEqual: '\u2244',
3853
+ NotTildeFullEqual: '\u2247',
3854
+ NotTildeTilde: '\u2249',
3855
+ NotVerticalBar: '\u2224',
3856
+ npar: '\u2226',
3857
+ nparallel: '\u2226',
3858
+ nparsl: '\u2AFD\u20E5',
3859
+ npart: '\u2202\u0338',
3860
+ npolint: '\u2A14',
3861
+ npr: '\u2280',
3862
+ nprcue: '\u22E0',
3863
+ npre: '\u2AAF\u0338',
3864
+ nprec: '\u2280',
3865
+ npreceq: '\u2AAF\u0338',
3866
+ nrArr: '\u21CF',
3867
+ nrarr: '\u219B',
3868
+ nrarrc: '\u2933\u0338',
3869
+ nrarrw: '\u219D\u0338',
3870
+ nRightarrow: '\u21CF',
3871
+ nrightarrow: '\u219B',
3872
+ nrtri: '\u22EB',
3873
+ nrtrie: '\u22ED',
3874
+ nsc: '\u2281',
3875
+ nsccue: '\u22E1',
3876
+ nsce: '\u2AB0\u0338',
3877
+ Nscr: '\uD835\uDCA9',
3878
+ nscr: '\uD835\uDCC3',
3879
+ nshortmid: '\u2224',
3880
+ nshortparallel: '\u2226',
3881
+ nsim: '\u2241',
3882
+ nsime: '\u2244',
3883
+ nsimeq: '\u2244',
3884
+ nsmid: '\u2224',
3885
+ nspar: '\u2226',
3886
+ nsqsube: '\u22E2',
3887
+ nsqsupe: '\u22E3',
3888
+ nsub: '\u2284',
3889
+ nsubE: '\u2AC5\u0338',
3890
+ nsube: '\u2288',
3891
+ nsubset: '\u2282\u20D2',
3892
+ nsubseteq: '\u2288',
3893
+ nsubseteqq: '\u2AC5\u0338',
3894
+ nsucc: '\u2281',
3895
+ nsucceq: '\u2AB0\u0338',
3896
+ nsup: '\u2285',
3897
+ nsupE: '\u2AC6\u0338',
3898
+ nsupe: '\u2289',
3899
+ nsupset: '\u2283\u20D2',
3900
+ nsupseteq: '\u2289',
3901
+ nsupseteqq: '\u2AC6\u0338',
3902
+ ntgl: '\u2279',
3903
+ Ntilde: '\u00D1',
3904
+ ntilde: '\u00F1',
3905
+ ntlg: '\u2278',
3906
+ ntriangleleft: '\u22EA',
3907
+ ntrianglelefteq: '\u22EC',
3908
+ ntriangleright: '\u22EB',
3909
+ ntrianglerighteq: '\u22ED',
3910
+ Nu: '\u039D',
3911
+ nu: '\u03BD',
3912
+ num: '\u0023',
3913
+ numero: '\u2116',
3914
+ numsp: '\u2007',
3915
+ nvap: '\u224D\u20D2',
3916
+ nVDash: '\u22AF',
3917
+ nVdash: '\u22AE',
3918
+ nvDash: '\u22AD',
3919
+ nvdash: '\u22AC',
3920
+ nvge: '\u2265\u20D2',
3921
+ nvgt: '\u003E\u20D2',
3922
+ nvHarr: '\u2904',
3923
+ nvinfin: '\u29DE',
3924
+ nvlArr: '\u2902',
3925
+ nvle: '\u2264\u20D2',
3926
+ nvlt: '\u003C\u20D2',
3927
+ nvltrie: '\u22B4\u20D2',
3928
+ nvrArr: '\u2903',
3929
+ nvrtrie: '\u22B5\u20D2',
3930
+ nvsim: '\u223C\u20D2',
3931
+ nwarhk: '\u2923',
3932
+ nwArr: '\u21D6',
3933
+ nwarr: '\u2196',
3934
+ nwarrow: '\u2196',
3935
+ nwnear: '\u2927',
3936
+ Oacute: '\u00D3',
3937
+ oacute: '\u00F3',
3938
+ oast: '\u229B',
3939
+ ocir: '\u229A',
3940
+ Ocirc: '\u00D4',
3941
+ ocirc: '\u00F4',
3942
+ Ocy: '\u041E',
3943
+ ocy: '\u043E',
3944
+ odash: '\u229D',
3945
+ Odblac: '\u0150',
3946
+ odblac: '\u0151',
3947
+ odiv: '\u2A38',
3948
+ odot: '\u2299',
3949
+ odsold: '\u29BC',
3950
+ OElig: '\u0152',
3951
+ oelig: '\u0153',
3952
+ ofcir: '\u29BF',
3953
+ Ofr: '\uD835\uDD12',
3954
+ ofr: '\uD835\uDD2C',
3955
+ ogon: '\u02DB',
3956
+ Ograve: '\u00D2',
3957
+ ograve: '\u00F2',
3958
+ ogt: '\u29C1',
3959
+ ohbar: '\u29B5',
3960
+ ohm: '\u03A9',
3961
+ oint: '\u222E',
3962
+ olarr: '\u21BA',
3963
+ olcir: '\u29BE',
3964
+ olcross: '\u29BB',
3965
+ oline: '\u203E',
3966
+ olt: '\u29C0',
3967
+ Omacr: '\u014C',
3968
+ omacr: '\u014D',
3969
+ Omega: '\u03A9',
3970
+ omega: '\u03C9',
3971
+ Omicron: '\u039F',
3972
+ omicron: '\u03BF',
3973
+ omid: '\u29B6',
3974
+ ominus: '\u2296',
3975
+ Oopf: '\uD835\uDD46',
3976
+ oopf: '\uD835\uDD60',
3977
+ opar: '\u29B7',
3978
+ OpenCurlyDoubleQuote: '\u201C',
3979
+ OpenCurlyQuote: '\u2018',
3980
+ operp: '\u29B9',
3981
+ oplus: '\u2295',
3982
+ Or: '\u2A54',
3983
+ or: '\u2228',
3984
+ orarr: '\u21BB',
3985
+ ord: '\u2A5D',
3986
+ order: '\u2134',
3987
+ orderof: '\u2134',
3988
+ ordf: '\u00AA',
3989
+ ordm: '\u00BA',
3990
+ origof: '\u22B6',
3991
+ oror: '\u2A56',
3992
+ orslope: '\u2A57',
3993
+ orv: '\u2A5B',
3994
+ oS: '\u24C8',
3995
+ Oscr: '\uD835\uDCAA',
3996
+ oscr: '\u2134',
3997
+ Oslash: '\u00D8',
3998
+ oslash: '\u00F8',
3999
+ osol: '\u2298',
4000
+ Otilde: '\u00D5',
4001
+ otilde: '\u00F5',
4002
+ Otimes: '\u2A37',
4003
+ otimes: '\u2297',
4004
+ otimesas: '\u2A36',
4005
+ Ouml: '\u00D6',
4006
+ ouml: '\u00F6',
4007
+ ovbar: '\u233D',
4008
+ OverBar: '\u203E',
4009
+ OverBrace: '\u23DE',
4010
+ OverBracket: '\u23B4',
4011
+ OverParenthesis: '\u23DC',
4012
+ par: '\u2225',
4013
+ para: '\u00B6',
4014
+ parallel: '\u2225',
4015
+ parsim: '\u2AF3',
4016
+ parsl: '\u2AFD',
4017
+ part: '\u2202',
4018
+ PartialD: '\u2202',
4019
+ Pcy: '\u041F',
4020
+ pcy: '\u043F',
4021
+ percnt: '\u0025',
4022
+ period: '\u002E',
4023
+ permil: '\u2030',
4024
+ perp: '\u22A5',
4025
+ pertenk: '\u2031',
4026
+ Pfr: '\uD835\uDD13',
4027
+ pfr: '\uD835\uDD2D',
4028
+ Phi: '\u03A6',
4029
+ phi: '\u03C6',
4030
+ phiv: '\u03D5',
4031
+ phmmat: '\u2133',
4032
+ phone: '\u260E',
4033
+ Pi: '\u03A0',
4034
+ pi: '\u03C0',
4035
+ pitchfork: '\u22D4',
4036
+ piv: '\u03D6',
4037
+ planck: '\u210F',
4038
+ planckh: '\u210E',
4039
+ plankv: '\u210F',
4040
+ plus: '\u002B',
4041
+ plusacir: '\u2A23',
4042
+ plusb: '\u229E',
4043
+ pluscir: '\u2A22',
4044
+ plusdo: '\u2214',
4045
+ plusdu: '\u2A25',
4046
+ pluse: '\u2A72',
4047
+ PlusMinus: '\u00B1',
4048
+ plusmn: '\u00B1',
4049
+ plussim: '\u2A26',
4050
+ plustwo: '\u2A27',
4051
+ pm: '\u00B1',
4052
+ Poincareplane: '\u210C',
4053
+ pointint: '\u2A15',
4054
+ Popf: '\u2119',
4055
+ popf: '\uD835\uDD61',
4056
+ pound: '\u00A3',
4057
+ Pr: '\u2ABB',
4058
+ pr: '\u227A',
4059
+ prap: '\u2AB7',
4060
+ prcue: '\u227C',
4061
+ prE: '\u2AB3',
4062
+ pre: '\u2AAF',
4063
+ prec: '\u227A',
4064
+ precapprox: '\u2AB7',
4065
+ preccurlyeq: '\u227C',
4066
+ Precedes: '\u227A',
4067
+ PrecedesEqual: '\u2AAF',
4068
+ PrecedesSlantEqual: '\u227C',
4069
+ PrecedesTilde: '\u227E',
4070
+ preceq: '\u2AAF',
4071
+ precnapprox: '\u2AB9',
4072
+ precneqq: '\u2AB5',
4073
+ precnsim: '\u22E8',
4074
+ precsim: '\u227E',
4075
+ Prime: '\u2033',
4076
+ prime: '\u2032',
4077
+ primes: '\u2119',
4078
+ prnap: '\u2AB9',
4079
+ prnE: '\u2AB5',
4080
+ prnsim: '\u22E8',
4081
+ prod: '\u220F',
4082
+ Product: '\u220F',
4083
+ profalar: '\u232E',
4084
+ profline: '\u2312',
4085
+ profsurf: '\u2313',
4086
+ prop: '\u221D',
4087
+ Proportion: '\u2237',
4088
+ Proportional: '\u221D',
4089
+ propto: '\u221D',
4090
+ prsim: '\u227E',
4091
+ prurel: '\u22B0',
4092
+ Pscr: '\uD835\uDCAB',
4093
+ pscr: '\uD835\uDCC5',
4094
+ Psi: '\u03A8',
4095
+ psi: '\u03C8',
4096
+ puncsp: '\u2008',
4097
+ Qfr: '\uD835\uDD14',
4098
+ qfr: '\uD835\uDD2E',
4099
+ qint: '\u2A0C',
4100
+ Qopf: '\u211A',
4101
+ qopf: '\uD835\uDD62',
4102
+ qprime: '\u2057',
4103
+ Qscr: '\uD835\uDCAC',
4104
+ qscr: '\uD835\uDCC6',
4105
+ quaternions: '\u210D',
4106
+ quatint: '\u2A16',
4107
+ quest: '\u003F',
4108
+ questeq: '\u225F',
4109
+ QUOT: '\u0022',
4110
+ quot: '\u0022',
4111
+ rAarr: '\u21DB',
4112
+ race: '\u223D\u0331',
4113
+ Racute: '\u0154',
4114
+ racute: '\u0155',
4115
+ radic: '\u221A',
4116
+ raemptyv: '\u29B3',
4117
+ Rang: '\u27EB',
4118
+ rang: '\u27E9',
4119
+ rangd: '\u2992',
4120
+ range: '\u29A5',
4121
+ rangle: '\u27E9',
4122
+ raquo: '\u00BB',
4123
+ Rarr: '\u21A0',
4124
+ rArr: '\u21D2',
4125
+ rarr: '\u2192',
4126
+ rarrap: '\u2975',
4127
+ rarrb: '\u21E5',
4128
+ rarrbfs: '\u2920',
4129
+ rarrc: '\u2933',
4130
+ rarrfs: '\u291E',
4131
+ rarrhk: '\u21AA',
4132
+ rarrlp: '\u21AC',
4133
+ rarrpl: '\u2945',
4134
+ rarrsim: '\u2974',
4135
+ Rarrtl: '\u2916',
4136
+ rarrtl: '\u21A3',
4137
+ rarrw: '\u219D',
4138
+ rAtail: '\u291C',
4139
+ ratail: '\u291A',
4140
+ ratio: '\u2236',
4141
+ rationals: '\u211A',
4142
+ RBarr: '\u2910',
4143
+ rBarr: '\u290F',
4144
+ rbarr: '\u290D',
4145
+ rbbrk: '\u2773',
4146
+ rbrace: '\u007D',
4147
+ rbrack: '\u005D',
4148
+ rbrke: '\u298C',
4149
+ rbrksld: '\u298E',
4150
+ rbrkslu: '\u2990',
4151
+ Rcaron: '\u0158',
4152
+ rcaron: '\u0159',
4153
+ Rcedil: '\u0156',
4154
+ rcedil: '\u0157',
4155
+ rceil: '\u2309',
4156
+ rcub: '\u007D',
4157
+ Rcy: '\u0420',
4158
+ rcy: '\u0440',
4159
+ rdca: '\u2937',
4160
+ rdldhar: '\u2969',
4161
+ rdquo: '\u201D',
4162
+ rdquor: '\u201D',
4163
+ rdsh: '\u21B3',
4164
+ Re: '\u211C',
4165
+ real: '\u211C',
4166
+ realine: '\u211B',
4167
+ realpart: '\u211C',
4168
+ reals: '\u211D',
4169
+ rect: '\u25AD',
4170
+ REG: '\u00AE',
4171
+ reg: '\u00AE',
4172
+ ReverseElement: '\u220B',
4173
+ ReverseEquilibrium: '\u21CB',
4174
+ ReverseUpEquilibrium: '\u296F',
4175
+ rfisht: '\u297D',
4176
+ rfloor: '\u230B',
4177
+ Rfr: '\u211C',
4178
+ rfr: '\uD835\uDD2F',
4179
+ rHar: '\u2964',
4180
+ rhard: '\u21C1',
4181
+ rharu: '\u21C0',
4182
+ rharul: '\u296C',
4183
+ Rho: '\u03A1',
4184
+ rho: '\u03C1',
4185
+ rhov: '\u03F1',
4186
+ RightAngleBracket: '\u27E9',
4187
+ RightArrow: '\u2192',
4188
+ Rightarrow: '\u21D2',
4189
+ rightarrow: '\u2192',
4190
+ RightArrowBar: '\u21E5',
4191
+ RightArrowLeftArrow: '\u21C4',
4192
+ rightarrowtail: '\u21A3',
4193
+ RightCeiling: '\u2309',
4194
+ RightDoubleBracket: '\u27E7',
4195
+ RightDownTeeVector: '\u295D',
4196
+ RightDownVector: '\u21C2',
4197
+ RightDownVectorBar: '\u2955',
4198
+ RightFloor: '\u230B',
4199
+ rightharpoondown: '\u21C1',
4200
+ rightharpoonup: '\u21C0',
4201
+ rightleftarrows: '\u21C4',
4202
+ rightleftharpoons: '\u21CC',
4203
+ rightrightarrows: '\u21C9',
4204
+ rightsquigarrow: '\u219D',
4205
+ RightTee: '\u22A2',
4206
+ RightTeeArrow: '\u21A6',
4207
+ RightTeeVector: '\u295B',
4208
+ rightthreetimes: '\u22CC',
4209
+ RightTriangle: '\u22B3',
4210
+ RightTriangleBar: '\u29D0',
4211
+ RightTriangleEqual: '\u22B5',
4212
+ RightUpDownVector: '\u294F',
4213
+ RightUpTeeVector: '\u295C',
4214
+ RightUpVector: '\u21BE',
4215
+ RightUpVectorBar: '\u2954',
4216
+ RightVector: '\u21C0',
4217
+ RightVectorBar: '\u2953',
4218
+ ring: '\u02DA',
4219
+ risingdotseq: '\u2253',
4220
+ rlarr: '\u21C4',
4221
+ rlhar: '\u21CC',
4222
+ rlm: '\u200F',
4223
+ rmoust: '\u23B1',
4224
+ rmoustache: '\u23B1',
4225
+ rnmid: '\u2AEE',
4226
+ roang: '\u27ED',
4227
+ roarr: '\u21FE',
4228
+ robrk: '\u27E7',
4229
+ ropar: '\u2986',
4230
+ Ropf: '\u211D',
4231
+ ropf: '\uD835\uDD63',
4232
+ roplus: '\u2A2E',
4233
+ rotimes: '\u2A35',
4234
+ RoundImplies: '\u2970',
4235
+ rpar: '\u0029',
4236
+ rpargt: '\u2994',
4237
+ rppolint: '\u2A12',
4238
+ rrarr: '\u21C9',
4239
+ Rrightarrow: '\u21DB',
4240
+ rsaquo: '\u203A',
4241
+ Rscr: '\u211B',
4242
+ rscr: '\uD835\uDCC7',
4243
+ Rsh: '\u21B1',
4244
+ rsh: '\u21B1',
4245
+ rsqb: '\u005D',
4246
+ rsquo: '\u2019',
4247
+ rsquor: '\u2019',
4248
+ rthree: '\u22CC',
4249
+ rtimes: '\u22CA',
4250
+ rtri: '\u25B9',
4251
+ rtrie: '\u22B5',
4252
+ rtrif: '\u25B8',
4253
+ rtriltri: '\u29CE',
4254
+ RuleDelayed: '\u29F4',
4255
+ ruluhar: '\u2968',
4256
+ rx: '\u211E',
4257
+ Sacute: '\u015A',
4258
+ sacute: '\u015B',
4259
+ sbquo: '\u201A',
4260
+ Sc: '\u2ABC',
4261
+ sc: '\u227B',
4262
+ scap: '\u2AB8',
4263
+ Scaron: '\u0160',
4264
+ scaron: '\u0161',
4265
+ sccue: '\u227D',
4266
+ scE: '\u2AB4',
4267
+ sce: '\u2AB0',
4268
+ Scedil: '\u015E',
4269
+ scedil: '\u015F',
4270
+ Scirc: '\u015C',
4271
+ scirc: '\u015D',
4272
+ scnap: '\u2ABA',
4273
+ scnE: '\u2AB6',
4274
+ scnsim: '\u22E9',
4275
+ scpolint: '\u2A13',
4276
+ scsim: '\u227F',
4277
+ Scy: '\u0421',
4278
+ scy: '\u0441',
4279
+ sdot: '\u22C5',
4280
+ sdotb: '\u22A1',
4281
+ sdote: '\u2A66',
4282
+ searhk: '\u2925',
4283
+ seArr: '\u21D8',
4284
+ searr: '\u2198',
4285
+ searrow: '\u2198',
4286
+ sect: '\u00A7',
4287
+ semi: '\u003B',
4288
+ seswar: '\u2929',
4289
+ setminus: '\u2216',
4290
+ setmn: '\u2216',
4291
+ sext: '\u2736',
4292
+ Sfr: '\uD835\uDD16',
4293
+ sfr: '\uD835\uDD30',
4294
+ sfrown: '\u2322',
4295
+ sharp: '\u266F',
4296
+ SHCHcy: '\u0429',
4297
+ shchcy: '\u0449',
4298
+ SHcy: '\u0428',
4299
+ shcy: '\u0448',
4300
+ ShortDownArrow: '\u2193',
4301
+ ShortLeftArrow: '\u2190',
4302
+ shortmid: '\u2223',
4303
+ shortparallel: '\u2225',
4304
+ ShortRightArrow: '\u2192',
4305
+ ShortUpArrow: '\u2191',
4306
+ shy: '\u00AD',
4307
+ Sigma: '\u03A3',
4308
+ sigma: '\u03C3',
4309
+ sigmaf: '\u03C2',
4310
+ sigmav: '\u03C2',
4311
+ sim: '\u223C',
4312
+ simdot: '\u2A6A',
4313
+ sime: '\u2243',
4314
+ simeq: '\u2243',
4315
+ simg: '\u2A9E',
4316
+ simgE: '\u2AA0',
4317
+ siml: '\u2A9D',
4318
+ simlE: '\u2A9F',
4319
+ simne: '\u2246',
4320
+ simplus: '\u2A24',
4321
+ simrarr: '\u2972',
4322
+ slarr: '\u2190',
4323
+ SmallCircle: '\u2218',
4324
+ smallsetminus: '\u2216',
4325
+ smashp: '\u2A33',
4326
+ smeparsl: '\u29E4',
4327
+ smid: '\u2223',
4328
+ smile: '\u2323',
4329
+ smt: '\u2AAA',
4330
+ smte: '\u2AAC',
4331
+ smtes: '\u2AAC\uFE00',
4332
+ SOFTcy: '\u042C',
4333
+ softcy: '\u044C',
4334
+ sol: '\u002F',
4335
+ solb: '\u29C4',
4336
+ solbar: '\u233F',
4337
+ Sopf: '\uD835\uDD4A',
4338
+ sopf: '\uD835\uDD64',
4339
+ spades: '\u2660',
4340
+ spadesuit: '\u2660',
4341
+ spar: '\u2225',
4342
+ sqcap: '\u2293',
4343
+ sqcaps: '\u2293\uFE00',
4344
+ sqcup: '\u2294',
4345
+ sqcups: '\u2294\uFE00',
4346
+ Sqrt: '\u221A',
4347
+ sqsub: '\u228F',
4348
+ sqsube: '\u2291',
4349
+ sqsubset: '\u228F',
4350
+ sqsubseteq: '\u2291',
4351
+ sqsup: '\u2290',
4352
+ sqsupe: '\u2292',
4353
+ sqsupset: '\u2290',
4354
+ sqsupseteq: '\u2292',
4355
+ squ: '\u25A1',
4356
+ Square: '\u25A1',
4357
+ square: '\u25A1',
4358
+ SquareIntersection: '\u2293',
4359
+ SquareSubset: '\u228F',
4360
+ SquareSubsetEqual: '\u2291',
4361
+ SquareSuperset: '\u2290',
4362
+ SquareSupersetEqual: '\u2292',
4363
+ SquareUnion: '\u2294',
4364
+ squarf: '\u25AA',
4365
+ squf: '\u25AA',
4366
+ srarr: '\u2192',
4367
+ Sscr: '\uD835\uDCAE',
4368
+ sscr: '\uD835\uDCC8',
4369
+ ssetmn: '\u2216',
4370
+ ssmile: '\u2323',
4371
+ sstarf: '\u22C6',
4372
+ Star: '\u22C6',
4373
+ star: '\u2606',
4374
+ starf: '\u2605',
4375
+ straightepsilon: '\u03F5',
4376
+ straightphi: '\u03D5',
4377
+ strns: '\u00AF',
4378
+ Sub: '\u22D0',
4379
+ sub: '\u2282',
4380
+ subdot: '\u2ABD',
4381
+ subE: '\u2AC5',
4382
+ sube: '\u2286',
4383
+ subedot: '\u2AC3',
4384
+ submult: '\u2AC1',
4385
+ subnE: '\u2ACB',
4386
+ subne: '\u228A',
4387
+ subplus: '\u2ABF',
4388
+ subrarr: '\u2979',
4389
+ Subset: '\u22D0',
4390
+ subset: '\u2282',
4391
+ subseteq: '\u2286',
4392
+ subseteqq: '\u2AC5',
4393
+ SubsetEqual: '\u2286',
4394
+ subsetneq: '\u228A',
4395
+ subsetneqq: '\u2ACB',
4396
+ subsim: '\u2AC7',
4397
+ subsub: '\u2AD5',
4398
+ subsup: '\u2AD3',
4399
+ succ: '\u227B',
4400
+ succapprox: '\u2AB8',
4401
+ succcurlyeq: '\u227D',
4402
+ Succeeds: '\u227B',
4403
+ SucceedsEqual: '\u2AB0',
4404
+ SucceedsSlantEqual: '\u227D',
4405
+ SucceedsTilde: '\u227F',
4406
+ succeq: '\u2AB0',
4407
+ succnapprox: '\u2ABA',
4408
+ succneqq: '\u2AB6',
4409
+ succnsim: '\u22E9',
4410
+ succsim: '\u227F',
4411
+ SuchThat: '\u220B',
4412
+ Sum: '\u2211',
4413
+ sum: '\u2211',
4414
+ sung: '\u266A',
4415
+ Sup: '\u22D1',
4416
+ sup: '\u2283',
4417
+ sup1: '\u00B9',
4418
+ sup2: '\u00B2',
4419
+ sup3: '\u00B3',
4420
+ supdot: '\u2ABE',
4421
+ supdsub: '\u2AD8',
4422
+ supE: '\u2AC6',
4423
+ supe: '\u2287',
4424
+ supedot: '\u2AC4',
4425
+ Superset: '\u2283',
4426
+ SupersetEqual: '\u2287',
4427
+ suphsol: '\u27C9',
4428
+ suphsub: '\u2AD7',
4429
+ suplarr: '\u297B',
4430
+ supmult: '\u2AC2',
4431
+ supnE: '\u2ACC',
4432
+ supne: '\u228B',
4433
+ supplus: '\u2AC0',
4434
+ Supset: '\u22D1',
4435
+ supset: '\u2283',
4436
+ supseteq: '\u2287',
4437
+ supseteqq: '\u2AC6',
4438
+ supsetneq: '\u228B',
4439
+ supsetneqq: '\u2ACC',
4440
+ supsim: '\u2AC8',
4441
+ supsub: '\u2AD4',
4442
+ supsup: '\u2AD6',
4443
+ swarhk: '\u2926',
4444
+ swArr: '\u21D9',
4445
+ swarr: '\u2199',
4446
+ swarrow: '\u2199',
4447
+ swnwar: '\u292A',
4448
+ szlig: '\u00DF',
4449
+ Tab: '\u0009',
4450
+ target: '\u2316',
4451
+ Tau: '\u03A4',
4452
+ tau: '\u03C4',
4453
+ tbrk: '\u23B4',
4454
+ Tcaron: '\u0164',
4455
+ tcaron: '\u0165',
4456
+ Tcedil: '\u0162',
4457
+ tcedil: '\u0163',
4458
+ Tcy: '\u0422',
4459
+ tcy: '\u0442',
4460
+ tdot: '\u20DB',
4461
+ telrec: '\u2315',
4462
+ Tfr: '\uD835\uDD17',
4463
+ tfr: '\uD835\uDD31',
4464
+ there4: '\u2234',
4465
+ Therefore: '\u2234',
4466
+ therefore: '\u2234',
4467
+ Theta: '\u0398',
4468
+ theta: '\u03B8',
4469
+ thetasym: '\u03D1',
4470
+ thetav: '\u03D1',
4471
+ thickapprox: '\u2248',
4472
+ thicksim: '\u223C',
4473
+ ThickSpace: '\u205F\u200A',
4474
+ thinsp: '\u2009',
4475
+ ThinSpace: '\u2009',
4476
+ thkap: '\u2248',
4477
+ thksim: '\u223C',
4478
+ THORN: '\u00DE',
4479
+ thorn: '\u00FE',
4480
+ Tilde: '\u223C',
4481
+ tilde: '\u02DC',
4482
+ TildeEqual: '\u2243',
4483
+ TildeFullEqual: '\u2245',
4484
+ TildeTilde: '\u2248',
4485
+ times: '\u00D7',
4486
+ timesb: '\u22A0',
4487
+ timesbar: '\u2A31',
4488
+ timesd: '\u2A30',
4489
+ tint: '\u222D',
4490
+ toea: '\u2928',
4491
+ top: '\u22A4',
4492
+ topbot: '\u2336',
4493
+ topcir: '\u2AF1',
4494
+ Topf: '\uD835\uDD4B',
4495
+ topf: '\uD835\uDD65',
4496
+ topfork: '\u2ADA',
4497
+ tosa: '\u2929',
4498
+ tprime: '\u2034',
4499
+ TRADE: '\u2122',
4500
+ trade: '\u2122',
4501
+ triangle: '\u25B5',
4502
+ triangledown: '\u25BF',
4503
+ triangleleft: '\u25C3',
4504
+ trianglelefteq: '\u22B4',
4505
+ triangleq: '\u225C',
4506
+ triangleright: '\u25B9',
4507
+ trianglerighteq: '\u22B5',
4508
+ tridot: '\u25EC',
4509
+ trie: '\u225C',
4510
+ triminus: '\u2A3A',
4511
+ TripleDot: '\u20DB',
4512
+ triplus: '\u2A39',
4513
+ trisb: '\u29CD',
4514
+ tritime: '\u2A3B',
4515
+ trpezium: '\u23E2',
4516
+ Tscr: '\uD835\uDCAF',
4517
+ tscr: '\uD835\uDCC9',
4518
+ TScy: '\u0426',
4519
+ tscy: '\u0446',
4520
+ TSHcy: '\u040B',
4521
+ tshcy: '\u045B',
4522
+ Tstrok: '\u0166',
4523
+ tstrok: '\u0167',
4524
+ twixt: '\u226C',
4525
+ twoheadleftarrow: '\u219E',
4526
+ twoheadrightarrow: '\u21A0',
4527
+ Uacute: '\u00DA',
4528
+ uacute: '\u00FA',
4529
+ Uarr: '\u219F',
4530
+ uArr: '\u21D1',
4531
+ uarr: '\u2191',
4532
+ Uarrocir: '\u2949',
4533
+ Ubrcy: '\u040E',
4534
+ ubrcy: '\u045E',
4535
+ Ubreve: '\u016C',
4536
+ ubreve: '\u016D',
4537
+ Ucirc: '\u00DB',
4538
+ ucirc: '\u00FB',
4539
+ Ucy: '\u0423',
4540
+ ucy: '\u0443',
4541
+ udarr: '\u21C5',
4542
+ Udblac: '\u0170',
4543
+ udblac: '\u0171',
4544
+ udhar: '\u296E',
4545
+ ufisht: '\u297E',
4546
+ Ufr: '\uD835\uDD18',
4547
+ ufr: '\uD835\uDD32',
4548
+ Ugrave: '\u00D9',
4549
+ ugrave: '\u00F9',
4550
+ uHar: '\u2963',
4551
+ uharl: '\u21BF',
4552
+ uharr: '\u21BE',
4553
+ uhblk: '\u2580',
4554
+ ulcorn: '\u231C',
4555
+ ulcorner: '\u231C',
4556
+ ulcrop: '\u230F',
4557
+ ultri: '\u25F8',
4558
+ Umacr: '\u016A',
4559
+ umacr: '\u016B',
4560
+ uml: '\u00A8',
4561
+ UnderBar: '\u005F',
4562
+ UnderBrace: '\u23DF',
4563
+ UnderBracket: '\u23B5',
4564
+ UnderParenthesis: '\u23DD',
4565
+ Union: '\u22C3',
4566
+ UnionPlus: '\u228E',
4567
+ Uogon: '\u0172',
4568
+ uogon: '\u0173',
4569
+ Uopf: '\uD835\uDD4C',
4570
+ uopf: '\uD835\uDD66',
4571
+ UpArrow: '\u2191',
4572
+ Uparrow: '\u21D1',
4573
+ uparrow: '\u2191',
4574
+ UpArrowBar: '\u2912',
4575
+ UpArrowDownArrow: '\u21C5',
4576
+ UpDownArrow: '\u2195',
4577
+ Updownarrow: '\u21D5',
4578
+ updownarrow: '\u2195',
4579
+ UpEquilibrium: '\u296E',
4580
+ upharpoonleft: '\u21BF',
4581
+ upharpoonright: '\u21BE',
4582
+ uplus: '\u228E',
4583
+ UpperLeftArrow: '\u2196',
4584
+ UpperRightArrow: '\u2197',
4585
+ Upsi: '\u03D2',
4586
+ upsi: '\u03C5',
4587
+ upsih: '\u03D2',
4588
+ Upsilon: '\u03A5',
4589
+ upsilon: '\u03C5',
4590
+ UpTee: '\u22A5',
4591
+ UpTeeArrow: '\u21A5',
4592
+ upuparrows: '\u21C8',
4593
+ urcorn: '\u231D',
4594
+ urcorner: '\u231D',
4595
+ urcrop: '\u230E',
4596
+ Uring: '\u016E',
4597
+ uring: '\u016F',
4598
+ urtri: '\u25F9',
4599
+ Uscr: '\uD835\uDCB0',
4600
+ uscr: '\uD835\uDCCA',
4601
+ utdot: '\u22F0',
4602
+ Utilde: '\u0168',
4603
+ utilde: '\u0169',
4604
+ utri: '\u25B5',
4605
+ utrif: '\u25B4',
4606
+ uuarr: '\u21C8',
4607
+ Uuml: '\u00DC',
4608
+ uuml: '\u00FC',
4609
+ uwangle: '\u29A7',
4610
+ vangrt: '\u299C',
4611
+ varepsilon: '\u03F5',
4612
+ varkappa: '\u03F0',
4613
+ varnothing: '\u2205',
4614
+ varphi: '\u03D5',
4615
+ varpi: '\u03D6',
4616
+ varpropto: '\u221D',
4617
+ vArr: '\u21D5',
4618
+ varr: '\u2195',
4619
+ varrho: '\u03F1',
4620
+ varsigma: '\u03C2',
4621
+ varsubsetneq: '\u228A\uFE00',
4622
+ varsubsetneqq: '\u2ACB\uFE00',
4623
+ varsupsetneq: '\u228B\uFE00',
4624
+ varsupsetneqq: '\u2ACC\uFE00',
4625
+ vartheta: '\u03D1',
4626
+ vartriangleleft: '\u22B2',
4627
+ vartriangleright: '\u22B3',
4628
+ Vbar: '\u2AEB',
4629
+ vBar: '\u2AE8',
4630
+ vBarv: '\u2AE9',
4631
+ Vcy: '\u0412',
4632
+ vcy: '\u0432',
4633
+ VDash: '\u22AB',
4634
+ Vdash: '\u22A9',
4635
+ vDash: '\u22A8',
4636
+ vdash: '\u22A2',
4637
+ Vdashl: '\u2AE6',
4638
+ Vee: '\u22C1',
4639
+ vee: '\u2228',
4640
+ veebar: '\u22BB',
4641
+ veeeq: '\u225A',
4642
+ vellip: '\u22EE',
4643
+ Verbar: '\u2016',
4644
+ verbar: '\u007C',
4645
+ Vert: '\u2016',
4646
+ vert: '\u007C',
4647
+ VerticalBar: '\u2223',
4648
+ VerticalLine: '\u007C',
4649
+ VerticalSeparator: '\u2758',
4650
+ VerticalTilde: '\u2240',
4651
+ VeryThinSpace: '\u200A',
4652
+ Vfr: '\uD835\uDD19',
4653
+ vfr: '\uD835\uDD33',
4654
+ vltri: '\u22B2',
4655
+ vnsub: '\u2282\u20D2',
4656
+ vnsup: '\u2283\u20D2',
4657
+ Vopf: '\uD835\uDD4D',
4658
+ vopf: '\uD835\uDD67',
4659
+ vprop: '\u221D',
4660
+ vrtri: '\u22B3',
4661
+ Vscr: '\uD835\uDCB1',
4662
+ vscr: '\uD835\uDCCB',
4663
+ vsubnE: '\u2ACB\uFE00',
4664
+ vsubne: '\u228A\uFE00',
4665
+ vsupnE: '\u2ACC\uFE00',
4666
+ vsupne: '\u228B\uFE00',
4667
+ Vvdash: '\u22AA',
4668
+ vzigzag: '\u299A',
4669
+ Wcirc: '\u0174',
4670
+ wcirc: '\u0175',
4671
+ wedbar: '\u2A5F',
4672
+ Wedge: '\u22C0',
4673
+ wedge: '\u2227',
4674
+ wedgeq: '\u2259',
4675
+ weierp: '\u2118',
4676
+ Wfr: '\uD835\uDD1A',
4677
+ wfr: '\uD835\uDD34',
4678
+ Wopf: '\uD835\uDD4E',
4679
+ wopf: '\uD835\uDD68',
4680
+ wp: '\u2118',
4681
+ wr: '\u2240',
4682
+ wreath: '\u2240',
4683
+ Wscr: '\uD835\uDCB2',
4684
+ wscr: '\uD835\uDCCC',
4685
+ xcap: '\u22C2',
4686
+ xcirc: '\u25EF',
4687
+ xcup: '\u22C3',
4688
+ xdtri: '\u25BD',
4689
+ Xfr: '\uD835\uDD1B',
4690
+ xfr: '\uD835\uDD35',
4691
+ xhArr: '\u27FA',
4692
+ xharr: '\u27F7',
4693
+ Xi: '\u039E',
4694
+ xi: '\u03BE',
4695
+ xlArr: '\u27F8',
4696
+ xlarr: '\u27F5',
4697
+ xmap: '\u27FC',
4698
+ xnis: '\u22FB',
4699
+ xodot: '\u2A00',
4700
+ Xopf: '\uD835\uDD4F',
4701
+ xopf: '\uD835\uDD69',
4702
+ xoplus: '\u2A01',
4703
+ xotime: '\u2A02',
4704
+ xrArr: '\u27F9',
4705
+ xrarr: '\u27F6',
4706
+ Xscr: '\uD835\uDCB3',
4707
+ xscr: '\uD835\uDCCD',
4708
+ xsqcup: '\u2A06',
4709
+ xuplus: '\u2A04',
4710
+ xutri: '\u25B3',
4711
+ xvee: '\u22C1',
4712
+ xwedge: '\u22C0',
4713
+ Yacute: '\u00DD',
4714
+ yacute: '\u00FD',
4715
+ YAcy: '\u042F',
4716
+ yacy: '\u044F',
4717
+ Ycirc: '\u0176',
4718
+ ycirc: '\u0177',
4719
+ Ycy: '\u042B',
4720
+ ycy: '\u044B',
4721
+ yen: '\u00A5',
4722
+ Yfr: '\uD835\uDD1C',
4723
+ yfr: '\uD835\uDD36',
4724
+ YIcy: '\u0407',
4725
+ yicy: '\u0457',
4726
+ Yopf: '\uD835\uDD50',
4727
+ yopf: '\uD835\uDD6A',
4728
+ Yscr: '\uD835\uDCB4',
4729
+ yscr: '\uD835\uDCCE',
4730
+ YUcy: '\u042E',
4731
+ yucy: '\u044E',
4732
+ Yuml: '\u0178',
4733
+ yuml: '\u00FF',
4734
+ Zacute: '\u0179',
4735
+ zacute: '\u017A',
4736
+ Zcaron: '\u017D',
4737
+ zcaron: '\u017E',
4738
+ Zcy: '\u0417',
4739
+ zcy: '\u0437',
4740
+ Zdot: '\u017B',
4741
+ zdot: '\u017C',
4742
+ zeetrf: '\u2128',
4743
+ ZeroWidthSpace: '\u200B',
4744
+ Zeta: '\u0396',
4745
+ zeta: '\u03B6',
4746
+ Zfr: '\u2128',
4747
+ zfr: '\uD835\uDD37',
4748
+ ZHcy: '\u0416',
4749
+ zhcy: '\u0436',
4750
+ zigrarr: '\u21DD',
4751
+ Zopf: '\u2124',
4752
+ zopf: '\uD835\uDD6B',
4753
+ Zscr: '\uD835\uDCB5',
4754
+ zscr: '\uD835\uDCCF',
4755
+ zwj: '\u200D',
4756
+ zwnj: '\u200C',
4757
+ });
4758
+
4759
+ /**
4760
+ * @deprecated use `HTML_ENTITIES` instead
4761
+ * @see HTML_ENTITIES
4762
+ */
4763
+ exports.entityMap = exports.HTML_ENTITIES;
4764
+
4765
+ },{"./conventions":2}],6:[function(require,module,exports){
4766
+ var dom = require('./dom')
4767
+ exports.DOMImplementation = dom.DOMImplementation
4768
+ exports.XMLSerializer = dom.XMLSerializer
4769
+ exports.DOMParser = require('./dom-parser').DOMParser
4770
+
4771
+ },{"./dom":4,"./dom-parser":3}],7:[function(require,module,exports){
4772
+ var NAMESPACE = require("./conventions").NAMESPACE;
2016
4773
 
2017
- },{}],5:[function(require,module,exports){
2018
4774
  //[4] NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
2019
4775
  //[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
2020
4776
  //[5] Name ::= NameStartChar (NameChar)*
@@ -2027,7 +4783,7 @@ var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:
2027
4783
  //S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
2028
4784
  //S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
2029
4785
  var S_TAG = 0;//tag name offerring
2030
- var S_ATTR = 1;//attr name offerring
4786
+ var S_ATTR = 1;//attr name offerring
2031
4787
  var S_ATTR_SPACE=2;//attr name end and space offer
2032
4788
  var S_EQ = 3;//=space?
2033
4789
  var S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)
@@ -2051,7 +4807,7 @@ ParseError.prototype = new Error();
2051
4807
  ParseError.prototype.name = ParseError.name
2052
4808
 
2053
4809
  function XMLReader(){
2054
-
4810
+
2055
4811
  }
2056
4812
 
2057
4813
  XMLReader.prototype = {
@@ -2080,8 +4836,8 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
2080
4836
  }
2081
4837
  function entityReplacer(a){
2082
4838
  var k = a.slice(1,-1);
2083
- if(k in entityMap){
2084
- return entityMap[k];
4839
+ if (Object.hasOwnProperty.call(entityMap, k)) {
4840
+ return entityMap[k];
2085
4841
  }else if(k.charAt(0) === '#'){
2086
4842
  return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))
2087
4843
  }else{
@@ -2110,7 +4866,7 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
2110
4866
  var lineEnd = 0;
2111
4867
  var linePattern = /.*(?:\r\n?|\n)|.*$/g
2112
4868
  var locator = domBuilder.locator;
2113
-
4869
+
2114
4870
  var parseStack = [{currentNSMap:defaultNSMapCopy}]
2115
4871
  var closeMap = {};
2116
4872
  var start = 0;
@@ -2132,10 +4888,10 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
2132
4888
  switch(source.charAt(tagStart+1)){
2133
4889
  case '/':
2134
4890
  var end = source.indexOf('>',tagStart+3);
2135
- var tagName = source.substring(tagStart+2,end);
4891
+ var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, '');
2136
4892
  var config = parseStack.pop();
2137
4893
  if(end<0){
2138
-
4894
+
2139
4895
  tagName = source.substring(tagStart+2).replace(/[\s<].*/,'');
2140
4896
  errorHandler.error("end tag name: "+tagName+' is not complete:'+config.tagName);
2141
4897
  end = tagStart+1+tagName.length;
@@ -2150,8 +4906,10 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
2150
4906
  if(endIgnoreCaseMach){
2151
4907
  domBuilder.endElement(config.uri,config.localName,tagName);
2152
4908
  if(localNSMap){
2153
- for(var prefix in localNSMap){
2154
- domBuilder.endPrefixMapping(prefix) ;
4909
+ for (var prefix in localNSMap) {
4910
+ if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
4911
+ domBuilder.endPrefixMapping(prefix);
4912
+ }
2155
4913
  }
2156
4914
  }
2157
4915
  if(!endMatch){
@@ -2160,7 +4918,7 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
2160
4918
  }else{
2161
4919
  parseStack.push(config)
2162
4920
  }
2163
-
4921
+
2164
4922
  end++;
2165
4923
  break;
2166
4924
  // end elment
@@ -2179,8 +4937,8 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
2179
4937
  //elStartEnd
2180
4938
  var end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);
2181
4939
  var len = el.length;
2182
-
2183
-
4940
+
4941
+
2184
4942
  if(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){
2185
4943
  el.closed = true;
2186
4944
  if(!entityMap.nbsp){
@@ -2205,12 +4963,10 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
2205
4963
  parseStack.push(el)
2206
4964
  }
2207
4965
  }
2208
-
2209
-
2210
-
2211
- if(el.uri === 'http://www.w3.org/1999/xhtml' && !el.closed){
4966
+
4967
+ if (NAMESPACE.isHTML(el.uri) && !el.closed) {
2212
4968
  end = parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder)
2213
- }else{
4969
+ } else {
2214
4970
  end++;
2215
4971
  }
2216
4972
  }
@@ -2247,8 +5003,18 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
2247
5003
  * @param {number} startIndex
2248
5004
  */
2249
5005
  function addAttribute(qname, value, startIndex) {
2250
- if (qname in el.attributeNames) errorHandler.fatalError('Attribute ' + qname + ' redefined')
2251
- el.addValue(qname, value, startIndex)
5006
+ if (el.attributeNames.hasOwnProperty(qname)) {
5007
+ errorHandler.fatalError('Attribute ' + qname + ' redefined')
5008
+ }
5009
+ el.addValue(
5010
+ qname,
5011
+ // @see https://www.w3.org/TR/xml/#AVNormalize
5012
+ // since the xmldom sax parser does not "interpret" DTD the following is not implemented:
5013
+ // - recursive replacement of (DTD) entity references
5014
+ // - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA
5015
+ value.replace(/[\t\n\r]/g, ' ').replace(/&#?\w+;/g, entityReplacer),
5016
+ startIndex
5017
+ )
2252
5018
  }
2253
5019
  var attrName;
2254
5020
  var value;
@@ -2279,7 +5045,7 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
2279
5045
  start = p+1;
2280
5046
  p = source.indexOf(c,start)
2281
5047
  if(p>0){
2282
- value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
5048
+ value = source.slice(start, p);
2283
5049
  addAttribute(attrName, value, start-1);
2284
5050
  s = S_ATTR_END;
2285
5051
  }else{
@@ -2287,10 +5053,8 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
2287
5053
  throw new Error('attribute value no end \''+c+'\' match');
2288
5054
  }
2289
5055
  }else if(s == S_ATTR_NOQUOT_VALUE){
2290
- value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
2291
- //console.log(attrName,value,start,p)
5056
+ value = source.slice(start, p);
2292
5057
  addAttribute(attrName, value, start);
2293
- //console.dir(el)
2294
5058
  errorHandler.warning('attribute "'+attrName+'" missed start quot('+c+')!!');
2295
5059
  start = p+1;
2296
5060
  s = S_ATTR_END
@@ -2310,7 +5074,9 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
2310
5074
  el.closed = true;
2311
5075
  case S_ATTR_NOQUOT_VALUE:
2312
5076
  case S_ATTR:
2313
- case S_ATTR_SPACE:
5077
+ break;
5078
+ case S_ATTR_SPACE:
5079
+ el.closed = true;
2314
5080
  break;
2315
5081
  //case S_EQ:
2316
5082
  default:
@@ -2344,9 +5110,9 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
2344
5110
  }
2345
5111
  if(s == S_ATTR_NOQUOT_VALUE){
2346
5112
  errorHandler.warning('attribute "'+value+'" missed quot(")!');
2347
- addAttribute(attrName, value.replace(/&#?\w+;/g,entityReplacer), start)
5113
+ addAttribute(attrName, value, start)
2348
5114
  }else{
2349
- if(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !value.match(/^(?:disabled|checked|selected)$/i)){
5115
+ if(!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)){
2350
5116
  errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
2351
5117
  }
2352
5118
  addAttribute(value, value, start)
@@ -2372,7 +5138,7 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
2372
5138
  s = S_ATTR_SPACE;
2373
5139
  break;
2374
5140
  case S_ATTR_NOQUOT_VALUE:
2375
- var value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
5141
+ var value = source.slice(start, p);
2376
5142
  errorHandler.warning('attribute "'+value+'" missed quot(")!!');
2377
5143
  addAttribute(attrName, value, start)
2378
5144
  case S_ATTR_END:
@@ -2394,7 +5160,7 @@ function parseElementStartPart(source,start,el,currentNSMap,entityReplacer,error
2394
5160
  //case S_ATTR_NOQUOT_VALUE:void();break;
2395
5161
  case S_ATTR_SPACE:
2396
5162
  var tagName = el.tagName;
2397
- if(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !attrName.match(/^(?:disabled|checked|selected)$/i)){
5163
+ if (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {
2398
5164
  errorHandler.warning('attribute "'+attrName+'" missed value!! "'+attrName+'" instead2!!')
2399
5165
  }
2400
5166
  addAttribute(attrName, attrName, start);
@@ -2444,7 +5210,7 @@ function appendElement(el,domBuilder,currentNSMap){
2444
5210
  }
2445
5211
  //can not set prefix,because prefix !== ''
2446
5212
  a.localName = localName ;
2447
- //prefix == null for no ns prefix attribute
5213
+ //prefix == null for no ns prefix attribute
2448
5214
  if(nsPrefix !== false){//hack!!
2449
5215
  if(localNSMap == null){
2450
5216
  localNSMap = {}
@@ -2453,8 +5219,8 @@ function appendElement(el,domBuilder,currentNSMap){
2453
5219
  //console.log(currentNSMap,1)
2454
5220
  }
2455
5221
  currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
2456
- a.uri = 'http://www.w3.org/2000/xmlns/'
2457
- domBuilder.startPrefixMapping(nsPrefix, value)
5222
+ a.uri = NAMESPACE.XMLNS
5223
+ domBuilder.startPrefixMapping(nsPrefix, value)
2458
5224
  }
2459
5225
  }
2460
5226
  var i = el.length;
@@ -2463,10 +5229,10 @@ function appendElement(el,domBuilder,currentNSMap){
2463
5229
  var prefix = a.prefix;
2464
5230
  if(prefix){//no prefix attribute has no namespace
2465
5231
  if(prefix === 'xml'){
2466
- a.uri = 'http://www.w3.org/XML/1998/namespace';
5232
+ a.uri = NAMESPACE.XML;
2467
5233
  }if(prefix !== 'xmlns'){
2468
5234
  a.uri = currentNSMap[prefix || '']
2469
-
5235
+
2470
5236
  //{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}
2471
5237
  }
2472
5238
  }
@@ -2487,8 +5253,10 @@ function appendElement(el,domBuilder,currentNSMap){
2487
5253
  if(el.closed){
2488
5254
  domBuilder.endElement(ns,localName,tagName);
2489
5255
  if(localNSMap){
2490
- for(prefix in localNSMap){
2491
- domBuilder.endPrefixMapping(prefix)
5256
+ for (prefix in localNSMap) {
5257
+ if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
5258
+ domBuilder.endPrefixMapping(prefix);
5259
+ }
2492
5260
  }
2493
5261
  }
2494
5262
  }else{
@@ -2515,7 +5283,7 @@ function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBui
2515
5283
  domBuilder.characters(text,0,text.length);
2516
5284
  return elEndStart;
2517
5285
  //}
2518
-
5286
+
2519
5287
  }
2520
5288
  }
2521
5289
  return elStartEnd+1;
@@ -2532,11 +5300,17 @@ function fixSelfClosed(source,elStartEnd,tagName,closeMap){
2532
5300
  closeMap[tagName] =pos
2533
5301
  }
2534
5302
  return pos<elStartEnd;
2535
- //}
5303
+ //}
2536
5304
  }
2537
- function _copy(source,target){
2538
- for(var n in source){target[n] = source[n]}
5305
+
5306
+ function _copy (source, target) {
5307
+ for (var n in source) {
5308
+ if (Object.prototype.hasOwnProperty.call(source, n)) {
5309
+ target[n] = source[n];
5310
+ }
5311
+ }
2539
5312
  }
5313
+
2540
5314
  function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
2541
5315
  var next= source.charAt(start+2)
2542
5316
  switch(next){
@@ -2560,11 +5334,11 @@ function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
2560
5334
  var end = source.indexOf(']]>',start+9);
2561
5335
  domBuilder.startCDATA();
2562
5336
  domBuilder.characters(source,start+9,end-start-9);
2563
- domBuilder.endCDATA()
5337
+ domBuilder.endCDATA()
2564
5338
  return end+3;
2565
5339
  }
2566
5340
  //<!DOCTYPE
2567
- //startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
5341
+ //startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
2568
5342
  var matchs = split(source,start);
2569
5343
  var len = matchs.length;
2570
5344
  if(len>1 && /!doctype/i.test(matchs[0][0])){
@@ -2582,7 +5356,7 @@ function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
2582
5356
  var lastMatch = matchs[len-1]
2583
5357
  domBuilder.startDTD(name, pubid, sysid);
2584
5358
  domBuilder.endDTD();
2585
-
5359
+
2586
5360
  return lastMatch.index+lastMatch[0].length
2587
5361
  }
2588
5362
  }
@@ -2631,7 +5405,7 @@ ElementAttributes.prototype = {
2631
5405
  getValue:function(i){return this[i].value}
2632
5406
  // ,getIndex:function(uri, localName)){
2633
5407
  // if(localName){
2634
- //
5408
+ //
2635
5409
  // }else{
2636
5410
  // var qName = uri
2637
5411
  // }
@@ -2658,7 +5432,7 @@ function split(source,start){
2658
5432
  exports.XMLReader = XMLReader;
2659
5433
  exports.ParseError = ParseError;
2660
5434
 
2661
- },{}],6:[function(require,module,exports){
5435
+ },{"./conventions":2}],8:[function(require,module,exports){
2662
5436
  'use strict'
2663
5437
 
2664
5438
  exports.byteLength = byteLength
@@ -2810,7 +5584,7 @@ function fromByteArray (uint8) {
2810
5584
  return parts.join('')
2811
5585
  }
2812
5586
 
2813
- },{}],7:[function(require,module,exports){
5587
+ },{}],9:[function(require,module,exports){
2814
5588
  (function (Buffer){(function (){
2815
5589
  /*!
2816
5590
  * The buffer module from node.js, for the browser.
@@ -4591,7 +7365,7 @@ function numberIsNaN (obj) {
4591
7365
  }
4592
7366
 
4593
7367
  }).call(this)}).call(this,require("buffer").Buffer)
4594
- },{"base64-js":6,"buffer":7,"ieee754":8}],8:[function(require,module,exports){
7368
+ },{"base64-js":8,"buffer":9,"ieee754":10}],10:[function(require,module,exports){
4595
7369
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
4596
7370
  exports.read = function (buffer, offset, isLE, mLen, nBytes) {
4597
7371
  var e, m