@markuplint/parser-utils 4.6.5 → 4.6.6

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/CHANGELOG.md CHANGED
@@ -3,16 +3,19 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [4.6.5](https://github.com/markuplint/markuplint/compare/@markuplint/parser-utils@4.6.4...@markuplint/parser-utils@4.6.5) (2024-06-25)
6
+ ## [4.6.6](https://github.com/markuplint/markuplint/compare/@markuplint/parser-utils@4.6.5...@markuplint/parser-utils@4.6.6) (2024-09-02)
7
7
 
8
+ **Note:** Version bump only for package @markuplint/parser-utils
8
9
 
9
- ### Bug Fixes
10
10
 
11
- * **parser-utils:** modify to treat attrs start with `script` type quotation marks as spread attr ([617b6d0](https://github.com/markuplint/markuplint/commit/617b6d0fbba1d245ca21360908b643f123818037))
12
11
 
13
12
 
14
13
 
14
+ ## [4.6.5](https://github.com/markuplint/markuplint/compare/@markuplint/parser-utils@4.6.4...@markuplint/parser-utils@4.6.5) (2024-06-25)
15
+
16
+ ### Bug Fixes
15
17
 
18
+ - **parser-utils:** modify to treat attrs start with `script` type quotation marks as spread attr ([617b6d0](https://github.com/markuplint/markuplint/commit/617b6d0fbba1d245ca21360908b643f123818037))
16
19
 
17
20
  ## [4.6.4](https://github.com/markuplint/markuplint/compare/@markuplint/parser-utils@4.6.3...@markuplint/parser-utils@4.6.4) (2024-06-09)
18
21
 
@@ -420,9 +420,9 @@ export function searchIDLAttribute(name) {
420
420
  const camelizedName = camelize(name);
421
421
  const [idlPropName, contentAttrName] = /^on[a-z]/.test(name)
422
422
  ? [name.toLowerCase(), name.toLowerCase()]
423
- : list.find(([idlPropName, contentAttrName]) => idlPropName.toLowerCase() === camelizedName.toLowerCase() ||
423
+ : (list.find(([idlPropName, contentAttrName]) => idlPropName.toLowerCase() === camelizedName.toLowerCase() ||
424
424
  contentAttrName.toLowerCase() === name.toLowerCase() ||
425
- hyphenize(idlPropName) === name.toLowerCase()) ?? [];
425
+ hyphenize(idlPropName) === name.toLowerCase()) ?? []);
426
426
  return {
427
427
  idlPropName,
428
428
  contentAttrName,
package/lib/parser.d.ts CHANGED
@@ -5,6 +5,7 @@ import { ParserError } from './parser-error.js';
5
5
  export declare abstract class Parser<Node extends {} = {}, State extends unknown = null> implements MLParser {
6
6
  #private;
7
7
  state: State;
8
+ constructor(options?: ParserOptions, defaultState?: State);
8
9
  get authoredElementName(): ParserAuthoredElementNameDistinguishing | undefined;
9
10
  /**
10
11
  * Detect value as a true if its attribute is booleanish value and omitted.
@@ -27,7 +28,6 @@ export declare abstract class Parser<Node extends {} = {}, State extends unknown
27
28
  get endTag(): EndTagType;
28
29
  get rawCode(): string;
29
30
  get tagNameCaseSensitive(): boolean;
30
- constructor(options?: ParserOptions, defaultState?: State);
31
31
  tokenize(options?: ParseOptions): Tokenized<Node, State>;
32
32
  beforeParse(rawCode: string, options?: ParseOptions): string;
33
33
  parse(rawCode: string, options?: ParseOptions): MLASTDocument;
package/lib/parser.js CHANGED
@@ -23,6 +23,33 @@ import { ignoreFrontMatter } from './ignore-front-matter.js';
23
23
  import { ParserError } from './parser-error.js';
24
24
  import { sortNodes } from './sort-nodes.js';
25
25
  export class Parser {
26
+ constructor(options, defaultState) {
27
+ _Parser_instances.add(this);
28
+ _Parser_booleanish.set(this, false);
29
+ _Parser_defaultState.set(this, void 0);
30
+ _Parser_endTagType.set(this, 'omittable');
31
+ _Parser_ignoreTags.set(this, []);
32
+ _Parser_maskChar.set(this, void 0);
33
+ _Parser_tagNameCaseSensitive.set(this, false);
34
+ _Parser_selfCloseType.set(this, 'html');
35
+ _Parser_spaceChars.set(this, defaultSpaces);
36
+ _Parser_rawTextElements.set(this, ['style', 'script']);
37
+ _Parser_authoredElementName.set(this, void 0);
38
+ _Parser_originalRawCode.set(this, '');
39
+ _Parser_rawCode.set(this, '');
40
+ _Parser_defaultDepth.set(this, 0);
41
+ _Parser_walkMethodSequentailPrevNode.set(this, null);
42
+ __classPrivateFieldSet(this, _Parser_booleanish, options?.booleanish ?? __classPrivateFieldGet(this, _Parser_booleanish, "f"), "f");
43
+ __classPrivateFieldSet(this, _Parser_endTagType, options?.endTagType ?? __classPrivateFieldGet(this, _Parser_endTagType, "f"), "f");
44
+ __classPrivateFieldSet(this, _Parser_ignoreTags, options?.ignoreTags ?? __classPrivateFieldGet(this, _Parser_ignoreTags, "f"), "f");
45
+ __classPrivateFieldSet(this, _Parser_maskChar, options?.maskChar ?? __classPrivateFieldGet(this, _Parser_maskChar, "f"), "f");
46
+ __classPrivateFieldSet(this, _Parser_tagNameCaseSensitive, options?.tagNameCaseSensitive ?? __classPrivateFieldGet(this, _Parser_tagNameCaseSensitive, "f"), "f");
47
+ __classPrivateFieldSet(this, _Parser_selfCloseType, options?.selfCloseType ?? __classPrivateFieldGet(this, _Parser_selfCloseType, "f"), "f");
48
+ __classPrivateFieldSet(this, _Parser_spaceChars, options?.spaceChars ?? __classPrivateFieldGet(this, _Parser_spaceChars, "f"), "f");
49
+ __classPrivateFieldSet(this, _Parser_rawTextElements, options?.rawTextElements ?? __classPrivateFieldGet(this, _Parser_rawTextElements, "f"), "f");
50
+ __classPrivateFieldSet(this, _Parser_defaultState, defaultState ?? null, "f");
51
+ this.state = structuredClone(__classPrivateFieldGet(this, _Parser_defaultState, "f"));
52
+ }
26
53
  get authoredElementName() {
27
54
  return __classPrivateFieldGet(this, _Parser_authoredElementName, "f");
28
55
  }
@@ -55,33 +82,6 @@ export class Parser {
55
82
  get tagNameCaseSensitive() {
56
83
  return __classPrivateFieldGet(this, _Parser_tagNameCaseSensitive, "f");
57
84
  }
58
- constructor(options, defaultState) {
59
- _Parser_instances.add(this);
60
- _Parser_booleanish.set(this, false);
61
- _Parser_defaultState.set(this, void 0);
62
- _Parser_endTagType.set(this, 'omittable');
63
- _Parser_ignoreTags.set(this, []);
64
- _Parser_maskChar.set(this, void 0);
65
- _Parser_tagNameCaseSensitive.set(this, false);
66
- _Parser_selfCloseType.set(this, 'html');
67
- _Parser_spaceChars.set(this, defaultSpaces);
68
- _Parser_rawTextElements.set(this, ['style', 'script']);
69
- _Parser_authoredElementName.set(this, void 0);
70
- _Parser_originalRawCode.set(this, '');
71
- _Parser_rawCode.set(this, '');
72
- _Parser_defaultDepth.set(this, 0);
73
- _Parser_walkMethodSequentailPrevNode.set(this, null);
74
- __classPrivateFieldSet(this, _Parser_booleanish, options?.booleanish ?? __classPrivateFieldGet(this, _Parser_booleanish, "f"), "f");
75
- __classPrivateFieldSet(this, _Parser_endTagType, options?.endTagType ?? __classPrivateFieldGet(this, _Parser_endTagType, "f"), "f");
76
- __classPrivateFieldSet(this, _Parser_ignoreTags, options?.ignoreTags ?? __classPrivateFieldGet(this, _Parser_ignoreTags, "f"), "f");
77
- __classPrivateFieldSet(this, _Parser_maskChar, options?.maskChar ?? __classPrivateFieldGet(this, _Parser_maskChar, "f"), "f");
78
- __classPrivateFieldSet(this, _Parser_tagNameCaseSensitive, options?.tagNameCaseSensitive ?? __classPrivateFieldGet(this, _Parser_tagNameCaseSensitive, "f"), "f");
79
- __classPrivateFieldSet(this, _Parser_selfCloseType, options?.selfCloseType ?? __classPrivateFieldGet(this, _Parser_selfCloseType, "f"), "f");
80
- __classPrivateFieldSet(this, _Parser_spaceChars, options?.spaceChars ?? __classPrivateFieldGet(this, _Parser_spaceChars, "f"), "f");
81
- __classPrivateFieldSet(this, _Parser_rawTextElements, options?.rawTextElements ?? __classPrivateFieldGet(this, _Parser_rawTextElements, "f"), "f");
82
- __classPrivateFieldSet(this, _Parser_defaultState, defaultState ?? null, "f");
83
- this.state = structuredClone(__classPrivateFieldGet(this, _Parser_defaultState, "f"));
84
- }
85
85
  tokenize(options) {
86
86
  return {
87
87
  ast: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/parser-utils",
3
- "version": "4.6.5",
3
+ "version": "4.6.6",
4
4
  "description": "Utility module for markuplint parser plugin",
5
5
  "repository": "git@github.com:markuplint/markuplint.git",
6
6
  "author": "Yusuke Hirao <yusukehirao@me.com>",
@@ -28,17 +28,17 @@
28
28
  "clean": "tsc --build --clean"
29
29
  },
30
30
  "dependencies": {
31
- "@markuplint/ml-ast": "4.4.2",
32
- "@markuplint/ml-spec": "4.6.3",
33
- "@markuplint/types": "4.5.3",
31
+ "@markuplint/ml-ast": "4.4.3",
32
+ "@markuplint/ml-spec": "4.6.4",
33
+ "@markuplint/types": "4.5.4",
34
34
  "@types/uuid": "10.0.0",
35
- "debug": "4.3.5",
35
+ "debug": "4.3.6",
36
36
  "espree": "10.1.0",
37
- "type-fest": "4.20.1",
37
+ "type-fest": "4.26.0",
38
38
  "uuid": "10.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@typescript-eslint/typescript-estree": "7.14.1"
41
+ "@typescript-eslint/typescript-estree": "8.3.0"
42
42
  },
43
- "gitHead": "05fdca254661ec335ff0cae4c6a11db164b032b9"
43
+ "gitHead": "77cd5a25d5cf28c83253b7bfe02cd25b54e236b0"
44
44
  }