@markuplint/ml-core 5.1.1 → 5.3.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.
- package/CHANGELOG.md +35 -0
- package/CLAUDE.md +11 -0
- package/lib/debug.d.ts +6 -0
- package/lib/debug.js +6 -0
- package/lib/ml-core.js +55 -16
- package/lib/ml-dom/helper/accname.js +4 -2
- package/lib/ml-dom/helper/foreign-attr-names.d.ts +13 -0
- package/lib/ml-dom/helper/foreign-attr-names.js +89 -0
- package/lib/ml-dom/node/attr.d.ts +80 -1
- package/lib/ml-dom/node/attr.js +150 -9
- package/lib/ml-dom/node/document.d.ts +53 -1
- package/lib/ml-dom/node/document.js +73 -8
- package/lib/ml-dom/node/element.d.ts +105 -4
- package/lib/ml-dom/node/element.js +327 -58
- package/lib/ml-dom/node/named-node-map.js +1 -1
- package/lib/ml-dom/node/node-store.js +4 -2
- package/lib/ml-dom/node/rule-mapper.js +21 -6
- package/lib/test/index.js +15 -6
- package/package.json +19 -19
package/lib/test/index.js
CHANGED
|
@@ -13,13 +13,22 @@ import { MLDocument } from '../ml-dom/node/document.js';
|
|
|
13
13
|
* @returns A parsed MLDocument instance
|
|
14
14
|
*/
|
|
15
15
|
export function createTestDocument(sourceCode, options) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
? options.parser.parser.parse(sourceCode, options.config?.parserOptions)
|
|
19
|
-
: options.parser.parse(sourceCode, options.config?.parserOptions)
|
|
20
|
-
: parser.parse(sourceCode, options?.config?.parserOptions);
|
|
16
|
+
const usedParser = options?.parser ? ('parser' in options.parser ? options.parser.parser : options.parser) : parser;
|
|
17
|
+
const ast = usedParser.parse(sourceCode, options?.config?.parserOptions);
|
|
21
18
|
const ruleset = convertRuleset(options?.config);
|
|
22
|
-
const document = new MLDocument(ast, ruleset, [options?.specs ?? spec, {}], { ariaVersion: ARIA_RECOMMENDED_VERSION },
|
|
19
|
+
const document = new MLDocument(ast, ruleset, [options?.specs ?? spec, {}], { ariaVersion: ARIA_RECOMMENDED_VERSION }, {
|
|
20
|
+
// The settings of the language are what the parser says, as `MLCore` hands them to the document
|
|
21
|
+
endTag: usedParser.endTag,
|
|
22
|
+
booleanish: usedParser.booleanish,
|
|
23
|
+
tagNameCaseSensitive: usedParser.tagNameCaseSensitive,
|
|
24
|
+
componentNameVariants: usedParser.componentNameVariants,
|
|
25
|
+
isComponentName: usedParser.isComponentName?.bind(usedParser),
|
|
26
|
+
// Only a parser with a list of its own (Vue) has it, as against `isComponentName` that the base class has
|
|
27
|
+
isNativeTag: 'isNativeTag' in usedParser ? usedParser.isNativeTag?.bind(usedParser) : undefined,
|
|
28
|
+
attrNameCaseSensitive: usedParser.attrNameCaseSensitive,
|
|
29
|
+
attrNameRoute: usedParser.attrNameRoute,
|
|
30
|
+
...(options?.pretenders ? { pretenders: options.pretenders } : {}),
|
|
31
|
+
});
|
|
23
32
|
return document;
|
|
24
33
|
}
|
|
25
34
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/ml-core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "The core module of markuplint",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
18
|
+
"types": "./lib/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
@@ -34,20 +34,20 @@
|
|
|
34
34
|
"./lib/configs.js": "./lib/configs.browser.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@markuplint/config-presets": "5.
|
|
38
|
-
"@markuplint/html-parser": "5.
|
|
39
|
-
"@markuplint/html-spec": "5.
|
|
40
|
-
"@markuplint/i18n": "5.
|
|
41
|
-
"@markuplint/ml-ast": "5.
|
|
42
|
-
"@markuplint/ml-config": "5.
|
|
43
|
-
"@markuplint/ml-spec": "5.
|
|
44
|
-
"@markuplint/parser-utils": "5.
|
|
45
|
-
"@markuplint/selector": "5.
|
|
46
|
-
"@markuplint/shared": "5.
|
|
47
|
-
"@types/debug": "4.1.13",
|
|
48
|
-
"debug": "4.4.3",
|
|
49
|
-
"is-plain-object": "5.
|
|
50
|
-
"type-fest": "5.
|
|
51
|
-
},
|
|
52
|
-
"gitHead": "
|
|
37
|
+
"@markuplint/config-presets": "5.3.0",
|
|
38
|
+
"@markuplint/html-parser": "5.3.0",
|
|
39
|
+
"@markuplint/html-spec": "5.3.0",
|
|
40
|
+
"@markuplint/i18n": "5.3.0",
|
|
41
|
+
"@markuplint/ml-ast": "5.3.0",
|
|
42
|
+
"@markuplint/ml-config": "5.3.0",
|
|
43
|
+
"@markuplint/ml-spec": "5.3.0",
|
|
44
|
+
"@markuplint/parser-utils": "5.3.0",
|
|
45
|
+
"@markuplint/selector": "5.3.0",
|
|
46
|
+
"@markuplint/shared": "5.3.0",
|
|
47
|
+
"@types/debug": "^4.1.13",
|
|
48
|
+
"debug": "^4.4.3",
|
|
49
|
+
"is-plain-object": "^5.1.0",
|
|
50
|
+
"type-fest": "^5.10.0"
|
|
51
|
+
},
|
|
52
|
+
"gitHead": "f587cf0206c8426e57369a48d6d5fb22306eafde"
|
|
53
53
|
}
|