fix: suppress highlighting error from comark render
This commit is contained in:
parent
9daddd1c8c
commit
6e0b5e507e
1 changed files with 7 additions and 0 deletions
|
|
@ -46,6 +46,13 @@ import zsh from "@shikijs/langs/zsh";
|
|||
import kanagawaLotus from "@shikijs/themes/kanagawa-lotus";
|
||||
import kanagawaWave from "@shikijs/themes/kanagawa-wave";
|
||||
|
||||
// Ignore error emitted to stderr by comark highlight plugin, when missing a language.
|
||||
const originalError = console.error;
|
||||
console.error = (...data: unknown[]) => {
|
||||
if (data.includes("Shiki highlighting error:")) return;
|
||||
else originalError(data);
|
||||
};
|
||||
|
||||
export async function renderMarkdown(
|
||||
text: PromiseLike<string> | string,
|
||||
columns: number,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue