From 5e7bce14afc18843de5cb48b3e33f56b44a0bcf8 Mon Sep 17 00:00:00 2001 From: Seb_Leib Date: Thu, 4 Dec 2025 03:41:41 +0800 Subject: [PATCH] Modify tikz renderer to print error causing script --- src/plugins/tikz.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/tikz.ts b/src/plugins/tikz.ts index 570cd42..64272ad 100644 --- a/src/plugins/tikz.ts +++ b/src/plugins/tikz.ts @@ -36,7 +36,7 @@ export function rehypeTikzDiag() { for (const { parent, index, newNode: tikzText } of replacements) { try { - const svg = (await renderTikzToSVG(tikzText)).replaceAll(/("#000"|"black")/g, `"currentColor"`); + const svg = (await renderTikzToSVG(tikzText)).replaceAll(/("#000"|"black")/g, `"currentColor"`); const tikzHast = fromHtml(svg, { fragment: true }); const diagram = select('svg', tikzHast); @@ -59,8 +59,8 @@ export function rehypeTikzDiag() { parent.children[index] = wrapper; } catch (err) { - console.warn('TikZ render failed:', err); + console.warn('TikZ render failed:', err, tikzText); } } }; -} \ No newline at end of file +}