@mui/internal-markdown 1.0.12 → 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 +2 -2
- package/parseMarkdown.js +7 -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.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,7 +16,7 @@
|
|
|
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
|
@@ -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>`,
|