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,
});