@mui/internal-markdown 1.0.11 → 1.0.12
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/package.json +2 -2
- package/parseMarkdown.js +12 -14
- package/prepareMarkdown.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-markdown",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "MUI markdown parser. This is an internal package not meant for general use.",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"prismjs": "^1.29.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@types/chai": "^4.3.
|
|
25
|
+
"@types/chai": "^4.3.19",
|
|
26
26
|
"chai": "^4.5.0"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
package/parseMarkdown.js
CHANGED
|
@@ -458,22 +458,20 @@ function createRender(context) {
|
|
|
458
458
|
}
|
|
459
459
|
return undefined;
|
|
460
460
|
},
|
|
461
|
-
|
|
462
461
|
renderer(token) {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
['info', 'success', 'warning', 'error'].includes(token.severity)
|
|
466
|
-
? [
|
|
467
|
-
'<div class="MuiCallout-icon-container">',
|
|
468
|
-
'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="ContentCopyRoundedIcon">',
|
|
469
|
-
`<use class="MuiCode-copied-icon" xlink:href="#${token.severity}-icon" />`,
|
|
470
|
-
'</svg>',
|
|
471
|
-
'</div>',
|
|
472
|
-
].join('\n')
|
|
473
|
-
: ''
|
|
462
|
+
if (!['info', 'success', 'warning', 'error'].includes(token.severity)) {
|
|
463
|
+
throw new Error(`docs-infra: Callout :::${token.severity} is not supported`);
|
|
474
464
|
}
|
|
475
|
-
|
|
476
|
-
|
|
465
|
+
|
|
466
|
+
return `<aside class="MuiCallout-root MuiCallout-${token.severity}">${[
|
|
467
|
+
'<div class="MuiCallout-icon-container">',
|
|
468
|
+
'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="ContentCopyRoundedIcon">',
|
|
469
|
+
`<use class="MuiCode-copied-icon" xlink:href="#${token.severity}-icon" />`,
|
|
470
|
+
'</svg>',
|
|
471
|
+
'</div>',
|
|
472
|
+
].join(
|
|
473
|
+
'\n',
|
|
474
|
+
)}<div class="MuiCallout-content">${this.parser.parse(token.tokens)}</div></aside>`;
|
|
477
475
|
},
|
|
478
476
|
},
|
|
479
477
|
],
|
package/prepareMarkdown.js
CHANGED
|
@@ -91,7 +91,7 @@ function prepareMarkdown(config) {
|
|
|
91
91
|
throw new Error(`docs-infra: Missing description in the page: ${location}\n`);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
if (description.length >
|
|
94
|
+
if (description.length > 160) {
|
|
95
95
|
throw new Error(
|
|
96
96
|
[
|
|
97
97
|
`docs-infra: The description "${description}" is too long (${description.length} characters).`,
|