@xmldom/xmldom 0.9.0-beta.6 → 0.9.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/sax.js CHANGED
@@ -6,16 +6,20 @@ var isHTMLEscapableRawTextElement = conventions.isHTMLEscapableRawTextElement;
6
6
  var NAMESPACE = conventions.NAMESPACE;
7
7
  var MIME_TYPE = conventions.MIME_TYPE;
8
8
 
9
- //[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]
10
- //[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
11
9
  //[5] Name ::= NameStartChar (NameChar)*
12
- var nameStartChar =
13
- /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; //\u10000-\uEFFFF
14
- var nameChar = new RegExp('[\\-\\.0-9' + nameStartChar.source.slice(1, -1) + '\\u00B7\\u0300-\\u036F\\u203F-\\u2040]');
10
+ // https://www.w3.org/TR/REC-xml/#NT-Name
11
+ // https://www.w3.org/TR/xml-names/#ns-qualnames
12
+ // roughly matches /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/
13
+ // which means we currently do not allow : as the first character in a tag name
15
14
  var tagNamePattern = new RegExp(
16
- '^' + nameStartChar.source + nameChar.source + '*(?::' + nameStartChar.source + nameChar.source + '*)?$'
15
+ '^' +
16
+ conventions.QNAME_START_CHAR.source +
17
+ conventions.NAME_CHAR.source +
18
+ '*(?:' +
19
+ conventions.NAME_START_CHAR.source +
20
+ conventions.NAME_CHAR.source +
21
+ '*)?$'
17
22
  );
18
- //var tagNamePattern = /^[a-zA-Z_][\w\-\.]*(?:\:[a-zA-Z_][\w\-\.]*)?$/
19
23
  //var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')
20
24
 
21
25
  //S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
@@ -313,7 +317,9 @@ function parseElementStartPart(source, start, el, currentNSMap, entityReplacer,
313
317
  el.closed = true;
314
318
  case S_ATTR_NOQUOT_VALUE:
315
319
  case S_ATTR:
320
+ break;
316
321
  case S_ATTR_SPACE:
322
+ el.closed = true;
317
323
  break;
318
324
  //case S_EQ:
319
325
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmldom/xmldom",
3
- "version": "0.9.0-beta.6",
3
+ "version": "0.9.0-beta.7",
4
4
  "description": "A pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module.",
5
5
  "keywords": [
6
6
  "w3c",
@@ -46,17 +46,17 @@
46
46
  "devDependencies": {
47
47
  "@stryker-mutator/core": "5.6.1",
48
48
  "auto-changelog": "2.4.0",
49
- "eslint": "8.26.0",
50
- "eslint-config-prettier": "8.5.0",
51
- "eslint-plugin-anti-trojan-source": "1.1.0",
49
+ "eslint": "8.40.0",
50
+ "eslint-config-prettier": "8.8.0",
51
+ "eslint-plugin-anti-trojan-source": "1.1.1",
52
52
  "eslint-plugin-es5": "1.5.0",
53
53
  "eslint-plugin-node": "11.1.0",
54
54
  "eslint-plugin-prettier": "4.2.1",
55
55
  "get-stream": "6.0.1",
56
56
  "jest": "27.5.1",
57
- "nodemon": "2.0.20",
58
- "np": "7.6.2",
59
- "prettier": "2.7.1",
57
+ "nodemon": "2.0.22",
58
+ "np": "7.7.0",
59
+ "prettier": "2.8.8",
60
60
  "xmltest": "1.5.0",
61
61
  "yauzl": "2.10.0"
62
62
  },