@mintlify/cli 4.0.1750 → 4.0.1752
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.
|
@@ -1,18 +1,21 @@
|
|
|
1
|
+
import { htmlVoidElements } from 'html-void-elements';
|
|
1
2
|
import { maskNonMarkup } from '../../mdx.js';
|
|
2
|
-
const
|
|
3
|
+
const VOID_TAG_NAMES = htmlVoidElements.filter((tag) => tag !== 'image');
|
|
4
|
+
const ATTRIBUTE = String.raw `"[^"]*"|'[^']*'|\{[^{}]*\}|[^<>"'{}]`;
|
|
5
|
+
const VOID_TAG = new RegExp(String.raw `<(${VOID_TAG_NAMES.join('|')})(?=[\s/>])(?:${ATTRIBUTE})*?(\/?)>`, 'g');
|
|
3
6
|
export const voidTags = {
|
|
4
7
|
id: 'void-tags',
|
|
5
8
|
group: 'content',
|
|
6
9
|
severity: 'error',
|
|
7
10
|
scope: 'file',
|
|
8
|
-
description: "self-close void HTML tags (<br>, <
|
|
11
|
+
description: "self-close void HTML tags (<br>, <img>, <source>, …); MDX can't parse them unclosed",
|
|
9
12
|
raw: true,
|
|
10
13
|
check: ({ content }) => {
|
|
11
14
|
var _a, _b;
|
|
12
15
|
const masked = maskNonMarkup(content);
|
|
13
16
|
const issues = [];
|
|
14
17
|
for (const match of masked.matchAll(VOID_TAG)) {
|
|
15
|
-
if (match[
|
|
18
|
+
if (match[2])
|
|
16
19
|
continue;
|
|
17
20
|
const start = match.index;
|
|
18
21
|
const end = start + match[0].length;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1752",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -45,18 +45,19 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@inquirer/prompts": "7.9.0",
|
|
48
|
-
"@mintlify/common": "1.0.
|
|
49
|
-
"@mintlify/link-rot": "3.0.
|
|
48
|
+
"@mintlify/common": "1.0.1312",
|
|
49
|
+
"@mintlify/link-rot": "3.0.1547",
|
|
50
50
|
"@mintlify/models": "0.0.379",
|
|
51
|
-
"@mintlify/og": "0.0.
|
|
52
|
-
"@mintlify/prebuild": "1.0.
|
|
53
|
-
"@mintlify/previewing": "4.0.
|
|
51
|
+
"@mintlify/og": "0.0.111",
|
|
52
|
+
"@mintlify/prebuild": "1.0.1482",
|
|
53
|
+
"@mintlify/previewing": "4.0.1565",
|
|
54
54
|
"@mintlify/validation": "0.1.944",
|
|
55
55
|
"adm-zip": "0.6.0",
|
|
56
56
|
"chalk": "5.2.0",
|
|
57
57
|
"color": "4.2.3",
|
|
58
58
|
"detect-port": "1.5.1",
|
|
59
59
|
"fs-extra": "11.2.0",
|
|
60
|
+
"html-void-elements": "3.0.0",
|
|
60
61
|
"ink": "6.3.0",
|
|
61
62
|
"inquirer": "12.3.0",
|
|
62
63
|
"js-yaml": "4.3.1",
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
"keytar": "7.9.0"
|
|
85
86
|
},
|
|
86
87
|
"devDependencies": {
|
|
87
|
-
"@mintlify/editor": "0.0.
|
|
88
|
+
"@mintlify/editor": "0.0.585",
|
|
88
89
|
"@mintlify/ts-config": "2.0.2",
|
|
89
90
|
"@tsconfig/recommended": "1.0.2",
|
|
90
91
|
"@types/detect-port": "1.3.2",
|
|
@@ -103,5 +104,5 @@
|
|
|
103
104
|
"vitest": "2.1.9",
|
|
104
105
|
"vitest-mock-process": "1.0.4"
|
|
105
106
|
},
|
|
106
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "7c39c086e33d0394dadb304ebcb6356605131650"
|
|
107
108
|
}
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
+
import { htmlVoidElements } from 'html-void-elements';
|
|
2
|
+
|
|
1
3
|
import { maskNonMarkup } from '../../mdx.js';
|
|
2
4
|
import type { FileRule, FileFinding } from '../../types.js';
|
|
3
5
|
|
|
4
|
-
const
|
|
6
|
+
const VOID_TAG_NAMES = htmlVoidElements.filter((tag) => tag !== 'image');
|
|
7
|
+
const ATTRIBUTE = String.raw`"[^"]*"|'[^']*'|\{[^{}]*\}|[^<>"'{}]`;
|
|
8
|
+
const VOID_TAG = new RegExp(
|
|
9
|
+
String.raw`<(${VOID_TAG_NAMES.join('|')})(?=[\s/>])(?:${ATTRIBUTE})*?(\/?)>`,
|
|
10
|
+
'g'
|
|
11
|
+
);
|
|
5
12
|
|
|
6
13
|
export const voidTags: FileRule = {
|
|
7
14
|
id: 'void-tags',
|
|
8
15
|
group: 'content',
|
|
9
16
|
severity: 'error',
|
|
10
17
|
scope: 'file',
|
|
11
|
-
description:
|
|
18
|
+
description:
|
|
19
|
+
"self-close void HTML tags (<br>, <img>, <source>, …); MDX can't parse them unclosed",
|
|
12
20
|
raw: true,
|
|
13
21
|
check: ({ content }) => {
|
|
14
22
|
const masked = maskNonMarkup(content);
|
|
15
23
|
const issues: FileFinding[] = [];
|
|
16
24
|
for (const match of masked.matchAll(VOID_TAG)) {
|
|
17
|
-
if (match[
|
|
25
|
+
if (match[2]) continue;
|
|
18
26
|
const start = match.index;
|
|
19
27
|
const end = start + match[0].length;
|
|
20
28
|
if (new RegExp(`^\\s*</${match[1]}\\s*>`).test(masked.slice(end))) continue;
|