Fixed deprecation notices on marked js

This commit is contained in:
Jan Böhmer 2023-06-26 21:48:39 +02:00
parent 6a0968cc02
commit 139ea879df
3 changed files with 25 additions and 0 deletions

View file

@ -21,6 +21,8 @@
import { Controller } from '@hotwired/stimulus';
import { marked } from "marked";
import { mangle } from "marked-mangle";
import { gfmHeadingId } from "marked-gfm-heading-id";
import DOMPurify from 'dompurify';
import "../../css/app/markdown.css";
@ -81,6 +83,10 @@ export default class extends Controller {
*/
configureMarked()
{
marked.use(mangle());
marked.use(gfmHeadingId({
}));
marked.setOptions({
gfm: true,
});

View file

@ -80,6 +80,8 @@
"jszip": "^3.2.0",
"katex": "^0.16.0",
"marked": "^5.1.0",
"marked-gfm-heading-id": "^3.0.4",
"marked-mangle": "^1.0.1",
"pdfmake": "^0.2.2",
"stimulus-use": "^0.52.0",
"tom-select": "^2.1.0",

View file

@ -3911,6 +3911,11 @@ get-tsconfig@^4.4.0:
dependencies:
resolve-pkg-maps "^1.0.0"
github-slugger@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-2.0.0.tgz#52cf2f9279a21eb6c59dd385b410f0c0adda8f1a"
integrity sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==
glob-parent@^5.1.2, glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
@ -4657,6 +4662,18 @@ make-dir@^3.0.2, make-dir@^3.1.0:
dependencies:
semver "^6.0.0"
marked-gfm-heading-id@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/marked-gfm-heading-id/-/marked-gfm-heading-id-3.0.4.tgz#cc54976b6c1e507f2abf7067208e5d135ef5c792"
integrity sha512-k22f+k8B449kRVXbi3OYxahI6t8HywKIF0wn0L0atzYhFHYRcJynLDekh+lcxcZkNnkEGRZOHuRfTcpjMjLqDw==
dependencies:
github-slugger "^2.0.0"
marked-mangle@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/marked-mangle/-/marked-mangle-1.0.1.tgz#022486251cde50a08a23b9675b3a7096266d7c3f"
integrity sha512-ZmWErsTkfE78OFgrpry2XGh+lYNRePfGy7bGh20l4rWHsH+bciKth1IHQXO9B6Ov5dHmY0jAswvgDxtcxGcFQQ==
marked@4.0.12:
version "4.0.12"
resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.12.tgz#2262a4e6fd1afd2f13557726238b69a48b982f7d"