Skip to content

Commit c0859e4

Browse files
Upgrade marked from 4.3.0 to 18.0.11
Our single call site parses plain GFM and sanitises with DOMPurify, so the intervening majors' breaking changes (removed sanitize/headerIds/ mangle options, the renderer token API rework) don't affect us. - Drop @types/marked: marked ships its own types since v6. - Pass async: false so parse() types as returning string rather than string | Promise<string>.
1 parent de12bc8 commit c0859e4

3 files changed

Lines changed: 10 additions & 15 deletions

File tree

package-lock.json

Lines changed: 5 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"@testing-library/react": "^14.0.0",
3030
"@testing-library/user-event": "^14.4.3",
3131
"@types/lunr": "^2.3.4",
32-
"@types/marked": "^4.0.1",
3332
"@types/node": "^24.12.0",
3433
"@types/react": "^18.3.3",
3534
"@types/react-dom": "^18.3.0",
@@ -40,7 +39,7 @@
4039
"lunr": "^2.3.9",
4140
"lunr-languages": "^1.14.0",
4241
"lzma": "^2.3.2",
43-
"marked": "^4.0.15",
42+
"marked": "^18.0.11",
4443
"mobile-drag-drop": "^2.3.0-rc.2",
4544
"react": "^18.3.1",
4645
"react-aria": "^3.50.0",

src/editor/codemirror/language-server/documentation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ export const renderMarkdown = (
7777
parts: DocSections = DocSections.All
7878
): SanitisedHtml => {
7979
const html = DOMPurify.sanitize(
80-
marked.parse(fixupMarkdown(subsetMarkdown(markdown, parts)), { gfm: true })
80+
marked.parse(fixupMarkdown(subsetMarkdown(markdown, parts)), {
81+
gfm: true,
82+
async: false,
83+
})
8184
);
8285
return {
8386
__html: html,

0 commit comments

Comments
 (0)