@mui/internal-markdown 1.0.11 → 1.0.13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/internal-markdown",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
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",
@@ -16,13 +16,13 @@
16
16
  "directory": "packages/markdown"
17
17
  },
18
18
  "dependencies": {
19
- "@babel/runtime": "^7.25.0",
19
+ "@babel/runtime": "^7.25.6",
20
20
  "lodash": "^4.17.21",
21
21
  "marked": "^13.0.3",
22
22
  "prismjs": "^1.29.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@types/chai": "^4.3.17",
25
+ "@types/chai": "^4.3.19",
26
26
  "chai": "^4.5.0"
27
27
  },
28
28
  "publishConfig": {
package/parseMarkdown.js CHANGED
@@ -366,7 +366,13 @@ function createRender(context) {
366
366
  }
367
367
 
368
368
  return [
369
- `<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>`,
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>`,
@@ -458,22 +464,20 @@ function createRender(context) {
458
464
  }
459
465
  return undefined;
460
466
  },
461
-
462
467
  renderer(token) {
463
- return `<aside class="MuiCallout-root MuiCallout-${token.severity}">
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
- : ''
468
+ if (!['info', 'success', 'warning', 'error'].includes(token.severity)) {
469
+ throw new Error(`docs-infra: Callout :::${token.severity} is not supported`);
474
470
  }
475
- <div class="MuiCallout-content">
476
- ${this.parser.parse(token.tokens)}\n</div></aside>`;
471
+
472
+ return `<aside class="MuiCallout-root MuiCallout-${token.severity}">${[
473
+ '<div class="MuiCallout-icon-container">',
474
+ '<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="ContentCopyRoundedIcon">',
475
+ `<use class="MuiCode-copied-icon" xlink:href="#${token.severity}-icon" />`,
476
+ '</svg>',
477
+ '</div>',
478
+ ].join(
479
+ '\n',
480
+ )}<div class="MuiCallout-content">${this.parser.parse(token.tokens)}</div></aside>`;
477
481
  },
478
482
  },
479
483
  ],
@@ -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 > 170) {
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).`,