@mui/internal-markdown 1.0.12 → 1.0.14
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/loader.js +1 -1
- package/package.json +3 -3
- package/parseMarkdown.js +11 -5
- package/prepareMarkdown.js +1 -1
package/loader.js
CHANGED
|
@@ -85,7 +85,7 @@ module.exports = async function demoLoader() {
|
|
|
85
85
|
if (
|
|
86
86
|
filename.startsWith(englishFilename) &&
|
|
87
87
|
matchNotEnglishMarkdown !== null &&
|
|
88
|
-
options.languagesInProgress.
|
|
88
|
+
options.languagesInProgress.includes(matchNotEnglishMarkdown[1])
|
|
89
89
|
) {
|
|
90
90
|
return {
|
|
91
91
|
filename,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-markdown",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
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",
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/mui/material-ui.git",
|
|
15
|
+
"url": "git+https://github.com/mui/material-ui.git",
|
|
16
16
|
"directory": "packages/markdown"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@babel/runtime": "^7.25.
|
|
19
|
+
"@babel/runtime": "^7.25.6",
|
|
20
20
|
"lodash": "^4.17.21",
|
|
21
21
|
"marked": "^13.0.3",
|
|
22
22
|
"prismjs": "^1.29.0"
|
package/parseMarkdown.js
CHANGED
|
@@ -79,7 +79,7 @@ function checkUrlHealth(href, linkText, context) {
|
|
|
79
79
|
* It needs to be:
|
|
80
80
|
* /material-ui/customization/theming/
|
|
81
81
|
*/
|
|
82
|
-
if (url.pathname
|
|
82
|
+
if (!url.pathname.endsWith('/')) {
|
|
83
83
|
throw new Error(
|
|
84
84
|
[
|
|
85
85
|
'docs-infra: Missing trailing slash. The following link:',
|
|
@@ -145,7 +145,7 @@ function getHeaders(markdown) {
|
|
|
145
145
|
while ((regexMatches = headerKeyValueRegExp.exec(header)) !== null) {
|
|
146
146
|
const key = regexMatches[1];
|
|
147
147
|
let value = regexMatches[2].replace(/(.*)/, '$1');
|
|
148
|
-
if (value
|
|
148
|
+
if (value.startsWith('[')) {
|
|
149
149
|
// Need double quotes to JSON parse.
|
|
150
150
|
value = value.replace(/'/g, '"');
|
|
151
151
|
// Remove the comma after the last value e.g. ["foo", "bar",] -> ["foo", "bar"].
|
|
@@ -275,12 +275,12 @@ const noSEOadvantage = [
|
|
|
275
275
|
'https://heroicons.com/',
|
|
276
276
|
'https://react-icons.github.io/',
|
|
277
277
|
'https://fontawesome.com/',
|
|
278
|
-
'https://www.radix-ui.com/',
|
|
279
278
|
'https://react-spectrum.adobe.com/',
|
|
280
279
|
'https://headlessui.com/',
|
|
281
280
|
'https://refine.dev/',
|
|
282
281
|
'https://scaffoldhub.io/',
|
|
283
282
|
'https://marmelab.com/',
|
|
283
|
+
'https://framesxdesign.com/',
|
|
284
284
|
];
|
|
285
285
|
|
|
286
286
|
/**
|
|
@@ -366,7 +366,13 @@ function createRender(context) {
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
return [
|
|
369
|
-
|
|
369
|
+
headingHtml.includes('<a ')
|
|
370
|
+
? [
|
|
371
|
+
// Avoid breaking the anchor link button
|
|
372
|
+
`<h${level} id="${hash}"><a href="#${hash}" class="title-link-to-anchor">${headingHtml}</a>`,
|
|
373
|
+
`<a href="#${hash}" class="title-link-to-anchor"><span class="anchor-icon"><svg><use xlink:href="#anchor-link-icon" /></svg></span></a>`,
|
|
374
|
+
].join('')
|
|
375
|
+
: `<h${level} id="${hash}"><a href="#${hash}" class="title-link-to-anchor">${headingHtml}<span class="anchor-icon"><svg><use xlink:href="#anchor-link-icon" /></svg></span></a>`,
|
|
370
376
|
`<button title="Post a comment" class="comment-link" data-feedback-hash="${hash}">`,
|
|
371
377
|
'<svg><use xlink:href="#comment-link-icon" /></svg>',
|
|
372
378
|
`</button>`,
|
|
@@ -381,7 +387,7 @@ function createRender(context) {
|
|
|
381
387
|
more += ` title="${title}"`;
|
|
382
388
|
}
|
|
383
389
|
|
|
384
|
-
if (noSEOadvantage.some((domain) => href.
|
|
390
|
+
if (noSEOadvantage.some((domain) => href.includes(domain))) {
|
|
385
391
|
more = ' target="_blank" rel="noopener nofollow"';
|
|
386
392
|
}
|
|
387
393
|
|
package/prepareMarkdown.js
CHANGED
|
@@ -36,7 +36,7 @@ function resolveComponentApiUrl(productId, componentPkg, component) {
|
|
|
36
36
|
if (productId === 'x-tree-view') {
|
|
37
37
|
return `/x/api/tree-view/${kebabCase(component)}/`;
|
|
38
38
|
}
|
|
39
|
-
if (componentPkg === 'mui-base' || BaseUIReexportedComponents.
|
|
39
|
+
if (componentPkg === 'mui-base' || BaseUIReexportedComponents.includes(component)) {
|
|
40
40
|
return `/base-ui/react-${kebabCase(component)}/components-api/#${kebabCase(component)}`;
|
|
41
41
|
}
|
|
42
42
|
if (productId === 'toolpad-core') {
|