@markuplint/ml-core 5.0.0-alpha.0 → 5.0.0-alpha.1
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 +4 -0
- package/docs/ml-dom/attr.ja.md +1 -1
- package/docs/ml-dom/attr.md +1 -1
- package/lib/ml-dom/node/attr.js +3 -3
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
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
|
+
# [5.0.0-alpha.1](https://github.com/markuplint/markuplint/compare/v5.0.0-alpha.0...v5.0.0-alpha.1) (2026-02-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @markuplint/ml-core
|
|
9
|
+
|
|
6
10
|
# [5.0.0-alpha.0](https://github.com/markuplint/markuplint/compare/v4.14.1...v5.0.0-alpha.0) (2026-02-20)
|
|
7
11
|
|
|
8
12
|
### Bug Fixes
|
package/docs/ml-dom/attr.ja.md
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
### IDL 属性名解決
|
|
32
32
|
|
|
33
|
-
ディレクティブパターン解決の後、spec が `
|
|
33
|
+
ディレクティブパターン解決の後、spec が `acceptedAttrNames` を設定しており(例: `@markuplint/react-spec` では `'idl'`、`@markuplint/svelte-spec` では `'both'`)、属性がディレクティブでない場合、コンストラクタは `@markuplint/parser-utils` の `searchIDLAttribute()` を呼び出して IDL プロパティ名を HTML コンテンツ属性名にマッピングします(例: `className` → `class`、`htmlFor` → `for`)。`'idl'` モードでは、IDL プロパティ名が候補として設定されます(例: `tabindex` → 「`tabIndex` の間違いでは?」)。`'both'` モードでは、コンテンツ名と IDL 名の両方が候補提案なしで受け入れられます。これはパーサーレベルではなくコアレベルの関心事です。
|
|
34
34
|
|
|
35
35
|
## トークン分解
|
|
36
36
|
|
package/docs/ml-dom/attr.md
CHANGED
|
@@ -30,7 +30,7 @@ When `astToken.potentialName` is not set by the parser, the `MLAttr` constructor
|
|
|
30
30
|
|
|
31
31
|
### IDL Attribute Name Resolution
|
|
32
32
|
|
|
33
|
-
After directive pattern resolution, if the spec sets `
|
|
33
|
+
After directive pattern resolution, if the spec sets `acceptedAttrNames` (e.g., `'idl'` in `@markuplint/react-spec`, `'both'` in `@markuplint/svelte-spec`) and the attribute is not a directive, the constructor calls `searchIDLAttribute()` from `@markuplint/parser-utils` to map IDL property names to HTML content attribute names (e.g., `className` -> `class`, `htmlFor` -> `for`). In `'idl'` mode, the IDL property name is set as a candidate for suggestion (e.g., `tabindex` -> "Did you mean `tabIndex`?"). In `'both'` mode, both content and IDL names are accepted without suggestions. This is a core-level concern, not a parser-level one.
|
|
34
34
|
|
|
35
35
|
## Token Decomposition
|
|
36
36
|
|
package/lib/ml-dom/node/attr.js
CHANGED
|
@@ -132,14 +132,14 @@ export class MLAttr extends MLNode {
|
|
|
132
132
|
this.isDuplicatable = this._astToken.isDuplicatable;
|
|
133
133
|
}
|
|
134
134
|
// IDL attribute resolution (after directivePatterns)
|
|
135
|
-
if (ownElement.ownerMLDocument.specs.
|
|
135
|
+
if (ownElement.ownerMLDocument.specs.acceptedAttrNames && !this.isDirective) {
|
|
136
136
|
const { contentAttrName, idlPropName } = searchIDLAttribute(this.#potentialName);
|
|
137
137
|
if (contentAttrName && contentAttrName !== this.#potentialName) {
|
|
138
138
|
this.#potentialName = contentAttrName;
|
|
139
139
|
}
|
|
140
140
|
// Set candidate for IDL naming suggestions (e.g., tabindex → tabIndex in JSX).
|
|
141
|
-
// Only
|
|
142
|
-
if (!resolution && idlPropName) {
|
|
141
|
+
// Only in 'idl' mode (React). In 'both' mode (Svelte), both content and IDL names are accepted.
|
|
142
|
+
if (!resolution && idlPropName && ownElement.ownerMLDocument.specs.acceptedAttrNames === 'idl') {
|
|
143
143
|
const rawName = this.nameNode?.raw ?? '';
|
|
144
144
|
if (rawName !== idlPropName) {
|
|
145
145
|
this.candidate = idlPropName;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/ml-core",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.1",
|
|
4
4
|
"description": "The core module of markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -30,20 +30,20 @@
|
|
|
30
30
|
"./lib/configs.js": "./lib/configs.browser.js"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@markuplint/config-presets": "5.0.0-alpha.
|
|
34
|
-
"@markuplint/html-parser": "5.0.0-alpha.
|
|
35
|
-
"@markuplint/html-spec": "5.0.0-alpha.
|
|
36
|
-
"@markuplint/i18n": "5.0.0-alpha.
|
|
37
|
-
"@markuplint/ml-ast": "5.0.0-alpha.
|
|
38
|
-
"@markuplint/ml-config": "5.0.0-alpha.
|
|
39
|
-
"@markuplint/ml-spec": "5.0.0-alpha.
|
|
40
|
-
"@markuplint/parser-utils": "5.0.0-alpha.
|
|
41
|
-
"@markuplint/selector": "5.0.0-alpha.
|
|
42
|
-
"@markuplint/shared": "5.0.0-alpha.
|
|
33
|
+
"@markuplint/config-presets": "5.0.0-alpha.1",
|
|
34
|
+
"@markuplint/html-parser": "5.0.0-alpha.1",
|
|
35
|
+
"@markuplint/html-spec": "5.0.0-alpha.1",
|
|
36
|
+
"@markuplint/i18n": "5.0.0-alpha.1",
|
|
37
|
+
"@markuplint/ml-ast": "5.0.0-alpha.1",
|
|
38
|
+
"@markuplint/ml-config": "5.0.0-alpha.1",
|
|
39
|
+
"@markuplint/ml-spec": "5.0.0-alpha.1",
|
|
40
|
+
"@markuplint/parser-utils": "5.0.0-alpha.1",
|
|
41
|
+
"@markuplint/selector": "5.0.0-alpha.1",
|
|
42
|
+
"@markuplint/shared": "5.0.0-alpha.1",
|
|
43
43
|
"@types/debug": "4.1.12",
|
|
44
44
|
"debug": "4.4.3",
|
|
45
45
|
"is-plain-object": "5.0.0",
|
|
46
46
|
"type-fest": "5.4.4"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "78a295e73a097a1ce09c777c06fa21ab68136387"
|
|
49
49
|
}
|