@markuplint/parser-utils 4.6.4-alpha.1 → 4.6.5

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,20 +3,22 @@
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.4-alpha.1](https://github.com/markuplint/markuplint/compare/@markuplint/parser-utils@4.6.4-alpha.0...@markuplint/parser-utils@4.6.4-alpha.1) (2024-06-02)
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)
7
7
 
8
8
 
9
9
  ### Bug Fixes
10
10
 
11
- * fix to export type files ([eff4bbf](https://github.com/markuplint/markuplint/commit/eff4bbfd127574809dc5e15d7cafe87699758ee0))
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
12
 
13
13
 
14
14
 
15
15
 
16
16
 
17
- ## [4.6.4-alpha.0](https://github.com/markuplint/markuplint/compare/@markuplint/parser-utils@4.6.3...@markuplint/parser-utils@4.6.4-alpha.0) (2024-06-02)
17
+ ## [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
18
 
19
- **Note:** Version bump only for package @markuplint/parser-utils
19
+ ### Bug Fixes
20
+
21
+ - fix to export type files ([eff4bbf](https://github.com/markuplint/markuplint/commit/eff4bbfd127574809dc5e15d7cafe87699758ee0))
20
22
 
21
23
  ## [4.6.3](https://github.com/markuplint/markuplint/compare/@markuplint/parser-utils@4.6.2...@markuplint/parser-utils@4.6.3) (2024-05-28)
22
24
 
@@ -25,7 +25,13 @@ export function attrTokenizer(raw, quoteSet = defaultQuoteSet, startState = Attr
25
25
  let valueType = noQuoteValueType;
26
26
  let parser;
27
27
  let quoteEnd = '';
28
- const isBeforeValueStarted = startState === AttrState.BeforeValue;
28
+ // If the `quoteSet` contains a `script` type quotation mark and an attribute starts with that quotation mark,
29
+ // the attribute name and equals sign are considered omitted.
30
+ const scriptStartChars = quoteSet.filter(quote => quote.type === 'script').map(quote => quote.start);
31
+ if (scriptStartChars.some(scriptStartChar => raw.trim().startsWith(scriptStartChar))) {
32
+ state = AttrState.BeforeValue;
33
+ }
34
+ const isBeforeValueStarted = state === AttrState.BeforeValue;
29
35
  const chars = [...raw];
30
36
  while (chars.length > 0) {
31
37
  if (state === AttrState.AfterValue) {
package/lib/parser.d.ts CHANGED
@@ -33,7 +33,7 @@ export declare abstract class Parser<Node extends {} = {}, State extends unknown
33
33
  parse(rawCode: string, options?: ParseOptions): MLASTDocument;
34
34
  afterParse(nodeList: readonly MLASTNodeTreeItem[], options?: ParseOptions): readonly MLASTNodeTreeItem[];
35
35
  parseError(error: any): ParserError;
36
- traverse(originNodes: readonly Node[], parentNode: MLASTParentNode | null | undefined, depth: number): {
36
+ traverse(originNodes: readonly Node[], parentNode: (MLASTParentNode | null) | undefined, depth: number): {
37
37
  childNodes: readonly MLASTChildNode[];
38
38
  siblings: readonly MLASTNodeTreeItem[];
39
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/parser-utils",
3
- "version": "4.6.4-alpha.1",
3
+ "version": "4.6.5",
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.1-alpha.1",
32
- "@markuplint/ml-spec": "4.6.2-alpha.1",
33
- "@markuplint/types": "4.5.2-alpha.1",
34
- "@types/uuid": "9.0.8",
31
+ "@markuplint/ml-ast": "4.4.2",
32
+ "@markuplint/ml-spec": "4.6.3",
33
+ "@markuplint/types": "4.5.3",
34
+ "@types/uuid": "10.0.0",
35
35
  "debug": "4.3.5",
36
- "espree": "10.0.1",
37
- "type-fest": "4.18.3",
38
- "uuid": "9.0.1"
36
+ "espree": "10.1.0",
37
+ "type-fest": "4.20.1",
38
+ "uuid": "10.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@typescript-eslint/typescript-estree": "7.11.0"
41
+ "@typescript-eslint/typescript-estree": "7.14.1"
42
42
  },
43
- "gitHead": "938c2164b55ad729da47a1851dc396c0033de3f7"
43
+ "gitHead": "05fdca254661ec335ff0cae4c6a11db164b032b9"
44
44
  }