@markuplint/rules 4.11.0 → 4.11.2
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 +14 -0
- package/lib/table-row-column-alignment/index.js +17 -1
- package/package.json +8 -8
- package/lib/__foo/index.d.ts +0 -2
- package/lib/__foo/index.js +0 -31
- package/lib/__foo/meta.d.ts +0 -4
- package/lib/__foo/meta.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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.11.2](https://github.com/markuplint/markuplint/compare/@markuplint/rules@4.11.1...@markuplint/rules@4.11.2) (2025-11-05)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @markuplint/rules
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [4.11.1](https://github.com/markuplint/markuplint/compare/@markuplint/rules@4.11.0...@markuplint/rules@4.11.1) (2025-08-24)
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
- **rules:** handle rowspan/colspan combinations correctly in table-row-column-alignment ([5579c98](https://github.com/markuplint/markuplint/commit/5579c98995fbad02086e2c9a5470cfcee5ef9ef0))
|
|
19
|
+
|
|
6
20
|
# [4.11.0](https://github.com/markuplint/markuplint/compare/@markuplint/rules@4.10.12...@markuplint/rules@4.11.0) (2025-08-13)
|
|
7
21
|
|
|
8
22
|
### Bug Fixes
|
|
@@ -37,6 +37,22 @@ export default createRule({
|
|
|
37
37
|
if (!rowEl) {
|
|
38
38
|
continue;
|
|
39
39
|
}
|
|
40
|
+
// Skip validation for rows that have expected column count differences due to rowspan/colspan
|
|
41
|
+
const cells = findChildren(rowEl, 'th, td');
|
|
42
|
+
let actualCellCount = 0;
|
|
43
|
+
for (const cell of cells) {
|
|
44
|
+
const colspan = Number.parseInt(cell.getAttribute('colspan') ?? '1');
|
|
45
|
+
actualCellCount += colspan;
|
|
46
|
+
}
|
|
47
|
+
// Check for rowspan cells occupying spaces in this row
|
|
48
|
+
const rowspanOccupiedCount = row.filter(cell => cell === '↓').length;
|
|
49
|
+
const expectedColumnCount = actualCellCount + rowspanOccupiedCount;
|
|
50
|
+
// Skip validation if the structure is valid accounting for spans
|
|
51
|
+
if (expectedColumnCount === baseColLength || actualCellCount + rowspanOccupiedCount === baseColLength) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
// Debug log
|
|
55
|
+
// console.log(`Row ${rowNum}: baseColLength=${baseColLength}, colLength=${colLength}, actualCellCount=${actualCellCount}, rowspanOccupiedCount=${rowspanOccupiedCount}, expectedColumnCount=${expectedColumnCount}`);
|
|
40
56
|
const indexes = getIndexes(row);
|
|
41
57
|
if (colLength > baseColLength) {
|
|
42
58
|
const index = indexes.slice(baseColLength)[0];
|
|
@@ -60,7 +76,7 @@ export default createRule({
|
|
|
60
76
|
message: t('{0} extra {1} in {2}', t(`${diff}`), t(diff === 1 ? 'column' : 'columns'), t('a {0}', t('row'))),
|
|
61
77
|
});
|
|
62
78
|
}
|
|
63
|
-
if (colLength < baseColLength) {
|
|
79
|
+
if (colLength < baseColLength && expectedColumnCount < baseColLength) {
|
|
64
80
|
const diff = baseColLength - colLength;
|
|
65
81
|
report({
|
|
66
82
|
scope: rowEl,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/rules",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.2",
|
|
4
4
|
"description": "Built-in rules of markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
"./lib/permitted-contents/debug.js": "./lib/permitted-contents/debug.browser.js"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@markuplint/html-spec": "4.
|
|
28
|
-
"@markuplint/ml-core": "4.13.
|
|
29
|
-
"@markuplint/ml-spec": "4.
|
|
30
|
-
"@markuplint/selector": "4.7.
|
|
27
|
+
"@markuplint/html-spec": "4.16.1",
|
|
28
|
+
"@markuplint/ml-core": "4.13.2",
|
|
29
|
+
"@markuplint/ml-spec": "4.10.1",
|
|
30
|
+
"@markuplint/selector": "4.7.7",
|
|
31
31
|
"@markuplint/shared": "4.4.12",
|
|
32
|
-
"@markuplint/types": "4.
|
|
32
|
+
"@markuplint/types": "4.8.1",
|
|
33
33
|
"@types/debug": "4.1.12",
|
|
34
34
|
"@ungap/structured-clone": "1.3.0",
|
|
35
35
|
"ansi-colors": "4.1.3",
|
|
36
36
|
"chrono-node": "2.8.4",
|
|
37
|
-
"debug": "4.4.
|
|
37
|
+
"debug": "4.4.3",
|
|
38
38
|
"type-fest": "4.41.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "6213ea30269ef404f030e67bbcc7fc7443ec1060"
|
|
41
41
|
}
|
package/lib/__foo/index.d.ts
DELETED
package/lib/__foo/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { createRule } from "@markuplint/ml-core";
|
|
2
|
-
import meta from "./meta.js";
|
|
3
|
-
export default createRule({
|
|
4
|
-
meta: meta,
|
|
5
|
-
defaultValue: true,
|
|
6
|
-
defaultOptions: null,
|
|
7
|
-
async verify({ document, report, t }) {
|
|
8
|
-
// Element
|
|
9
|
-
await document.walkOn("Element", (el) => {
|
|
10
|
-
const raw = el.raw.trim();
|
|
11
|
-
if (/./.test(raw)) {
|
|
12
|
-
report({
|
|
13
|
-
scope: el,
|
|
14
|
-
message: t("It is {0}", "issue"),
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
// Attribute
|
|
19
|
-
await document.walkOn("Attr", (attr) => {
|
|
20
|
-
if (/./.test(attr.name)) {
|
|
21
|
-
report({
|
|
22
|
-
scope: attr,
|
|
23
|
-
line: attr.nameNode?.startLine,
|
|
24
|
-
col: attr.nameNode?.startCol,
|
|
25
|
-
raw: attr.nameNode?.raw,
|
|
26
|
-
message: t("It is {0}", "issue"),
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
});
|
package/lib/__foo/meta.d.ts
DELETED
package/lib/__foo/meta.js
DELETED