Skip to content

Commit

Permalink
Silence punycode warning
Browse files Browse the repository at this point in the history
  • Loading branch information
irskep committed Sep 10, 2024
1 parent 7d18cba commit 6652a12
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plugins/syntaxHighlightingPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,16 @@ export class SyntaxHighlightingPlugin implements DjockeyPlugin {
}

async setup() {
// TODO: monkey-patch console.error here
// Some transitive dependencies of myst-parser pin an old version of markdown-it which
// imports the deprecated module 'punycode'. It happens to trigger the deprecation
// warning here. Silence it for the sake of the users.
const err = console.error;
console.error = () => {};
this.djotHighlighter = await createHighlighter({
langs: [djotTextmateGrammar as unknown as LanguageRegistration],
themes: [this.themeLight, this.themeDark],
});
console.error = err;
}

async highlight(text: string, lang: string): Promise<string> {
Expand Down

0 comments on commit 6652a12

Please sign in to comment.