diff --git a/package-lock.json b/package-lock.json index 12b0c973d..9f67465e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "glob": "^7.2.0", "lunr": "^2.3.9", - "marked": "^3.0.8", + "marked": "^4.0.10", "minimatch": "^3.0.4", "shiki": "^0.9.12" }, @@ -21,7 +21,7 @@ "devDependencies": { "@types/glob": "^7.2.0", "@types/lunr": "^2.3.4", - "@types/marked": "^3.0.3", + "@types/marked": "^4.0.1", "@types/minimatch": "3.0.5", "@types/mocha": "^9.0.0", "@types/node": "^16.11.9", @@ -81,6 +81,10 @@ }, "engines": { "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" } }, "node_modules/@babel/core/node_modules/semver": { @@ -501,9 +505,9 @@ "dev": true }, "node_modules/@types/marked": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/marked/-/marked-3.0.3.tgz", - "integrity": "sha512-ZgAr847Wl68W+B0sWH7F4fDPxTzerLnRuUXjUpp1n4NjGSs8hgPAjAp7NQIXblG34MXTrf5wWkAK8PVJ2LIlVg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/marked/-/marked-4.0.1.tgz", + "integrity": "sha512-ZigEmCWdNUU7IjZEuQ/iaimYdDHWHfTe3kg8ORfKjyGYd9RWumPoOJRQXB0bO+XLkNwzCthW3wUIQtANaEZ1ag==", "dev": true }, "node_modules/@types/mime-types": { @@ -1655,7 +1659,7 @@ "version": "2.6.12", "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", - "deprecated": "core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.", + "deprecated": "core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.", "dev": true, "hasInstallScript": true }, @@ -3377,6 +3381,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" } }, "node_modules/find-index": { @@ -3508,7 +3515,21 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz", "integrity": "sha512-Xu2Qh8yqYuDhQGOhD5iJGninErSfI9A3FrriD3tjUgV5VbJFeH8vfgZ9HnC6jWN80QDVNQK5vmxRAmEAp7Mevw==", - "dev": true + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/fs-constants": { "version": "1.0.0", @@ -5071,6 +5092,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/make-dir/node_modules/semver": { @@ -5113,11 +5137,11 @@ } }, "node_modules/marked": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.8.tgz", - "integrity": "sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.10.tgz", + "integrity": "sha512-+QvuFj0nGgO970fySghXGmuw+Fd0gD2x3+MqCWLIPf5oxdv1Ka6b2q+z9RP01P/IaKPMEramy+7cNy/Lw8c3hw==", "bin": { - "marked": "bin/marked" + "marked": "bin/marked.js" }, "engines": { "node": ">= 12" @@ -5330,6 +5354,9 @@ "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/find-up": { @@ -5343,6 +5370,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/glob": { @@ -5396,6 +5426,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/ms": { @@ -5414,6 +5447,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/p-locate": { @@ -5426,6 +5462,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mocha/node_modules/supports-color": { @@ -5438,6 +5477,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/ms": { @@ -5647,6 +5689,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/nyc/node_modules/cliui": { @@ -6112,6 +6157,9 @@ }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { @@ -7147,6 +7195,9 @@ "dev": true, "dependencies": { "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-from": { @@ -7207,6 +7258,9 @@ }, "bin": { "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/run-async": { @@ -7600,6 +7654,7 @@ "version": "0.5.3", "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", "dev": true, "dependencies": { "atob": "^2.1.2", @@ -7613,6 +7668,7 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "deprecated": "See https://github.com/lydell/source-map-url#deprecated", "dev": true }, "node_modules/spawn-wrap": { @@ -7698,6 +7754,11 @@ "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, "engines": { "node": ">=0.10.0" } @@ -7875,6 +7936,9 @@ "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/subarg": { @@ -8311,6 +8375,7 @@ "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "dev": true, "bin": { "uuid": "bin/uuid" @@ -8440,6 +8505,9 @@ }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/wrap-ansi/node_modules/ansi-styles": { @@ -8452,6 +8520,9 @@ }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/wrap-ansi/node_modules/color-convert": { @@ -8579,6 +8650,9 @@ "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/yargs-unparser/node_modules/decamelize": { @@ -8588,6 +8662,9 @@ "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/yauzl": { @@ -8607,6 +8684,9 @@ "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } } }, @@ -9017,9 +9097,9 @@ "dev": true }, "@types/marked": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/marked/-/marked-3.0.3.tgz", - "integrity": "sha512-ZgAr847Wl68W+B0sWH7F4fDPxTzerLnRuUXjUpp1n4NjGSs8hgPAjAp7NQIXblG34MXTrf5wWkAK8PVJ2LIlVg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/marked/-/marked-4.0.1.tgz", + "integrity": "sha512-ZigEmCWdNUU7IjZEuQ/iaimYdDHWHfTe3kg8ORfKjyGYd9RWumPoOJRQXB0bO+XLkNwzCthW3wUIQtANaEZ1ag==", "dev": true }, "@types/mime-types": { @@ -12500,9 +12580,9 @@ } }, "marked": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/marked/-/marked-3.0.8.tgz", - "integrity": "sha512-0gVrAjo5m0VZSJb4rpL59K1unJAMb/hm8HRXqasD8VeC8m91ytDPMritgFSlKonfdt+rRYYpP/JfLxgIX8yoSw==" + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.0.10.tgz", + "integrity": "sha512-+QvuFj0nGgO970fySghXGmuw+Fd0gD2x3+MqCWLIPf5oxdv1Ka6b2q+z9RP01P/IaKPMEramy+7cNy/Lw8c3hw==" }, "math-random": { "version": "1.0.4", diff --git a/package.json b/package.json index 1694c78ab..ba4a5e9ea 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "dependencies": { "glob": "^7.2.0", "lunr": "^2.3.9", - "marked": "^3.0.8", + "marked": "^4.0.10", "minimatch": "^3.0.4", "shiki": "^0.9.12" }, @@ -33,7 +33,7 @@ "devDependencies": { "@types/glob": "^7.2.0", "@types/lunr": "^2.3.4", - "@types/marked": "^3.0.3", + "@types/marked": "^4.0.1", "@types/minimatch": "3.0.5", "@types/mocha": "^9.0.0", "@types/node": "^16.11.9", diff --git a/src/lib/output/themes/MarkedPlugin.ts b/src/lib/output/themes/MarkedPlugin.ts index d7c35cde5..475037cfd 100644 --- a/src/lib/output/themes/MarkedPlugin.ts +++ b/src/lib/output/themes/MarkedPlugin.ts @@ -151,7 +151,7 @@ output file : protected override onBeginRenderer(event: RendererEvent) { super.onBeginRenderer(event); - Marked.setOptions(this.createMarkedOptions()); + Marked.marked.setOptions(this.createMarkedOptions()); delete this.includes; if (this.includeSource) { @@ -190,10 +190,10 @@ output file : * * @returns The options object for the markdown parser. */ - private createMarkedOptions(): Marked.MarkedOptions { + private createMarkedOptions(): Marked.marked.MarkedOptions { const markedOptions = (this.application.options.getValue( "markedOptions" - ) ?? {}) as Marked.MarkedOptions; + ) ?? {}) as Marked.marked.MarkedOptions; // Set some default values if they are not specified via the TypeDoc option markedOptions.highlight ??= (text: any, lang: any) => @@ -210,6 +210,6 @@ output file : * @param event */ onParseMarkdown(event: MarkdownEvent) { - event.parsedText = Marked(event.parsedText); + event.parsedText = Marked.marked(event.parsedText); } }