From ad65e6cc54ffc78db1151d791f9365d037e2c2e9 Mon Sep 17 00:00:00 2001 From: Diogo Kiss Date: Mon, 4 Sep 2023 13:50:36 +0200 Subject: [PATCH] fix: remove marked deprecation warning This commit disables to flags that are deprecated in the 'marked-terminal' as pointed in the following issue. https://github.com/markedjs/marked/issues/2793 ``` marked(): mangle parameter is enabled by default, but is deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-mangle, or disable by setting `{mangle: false}`. marked(): headerIds and headerPrefix parameters enabled by default, but are deprecated since version 5.0.0, and will be removed in the future. To clear this warning, install https://www.npmjs.com/package/marked-gfm-heading-id, or disable by setting `{headerIds: false}`. ``` --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 5905e4469d..34ed7a6a21 100644 --- a/index.js +++ b/index.js @@ -28,6 +28,10 @@ async function terminalOutput(text) { if (!markedOptionsSet) { const { default: TerminalRenderer } = await import("marked-terminal"); // eslint-disable-line node/no-unsupported-features/es-syntax marked.setOptions({ renderer: new TerminalRenderer() }); + marked.use({ + mangle: false, + headerIds: false, + }); markedOptionsSet = true; }