summaryrefslogtreecommitdiff
path: root/packages/integrations/mdx/src
diff options
context:
space:
mode:
authorGravatar Giuseppe La Torre <giuseppelt@users.noreply.github.com> 2023-01-12 13:15:51 +0100
committerGravatar GitHub <noreply@github.com> 2023-01-12 20:15:51 +0800
commit12f65a4d55e3fd2993c2f67b18794dd536280c69 (patch)
tree7841f84b39afcd3ae03bdc6dcc7188b27a308377 /packages/integrations/mdx/src
parentc53b1fca073136e1e1a6f5d0b32d7c023e98c675 (diff)
downloadastro-12f65a4d55e3fd2993c2f67b18794dd536280c69.tar.gz
astro-12f65a4d55e3fd2993c2f67b18794dd536280c69.tar.zst
astro-12f65a4d55e3fd2993c2f67b18794dd536280c69.zip
fix shiki css class replace logic in md and mdx integrations (#5837)
Diffstat (limited to 'packages/integrations/mdx/src')
-rw-r--r--packages/integrations/mdx/src/remark-shiki.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/integrations/mdx/src/remark-shiki.ts b/packages/integrations/mdx/src/remark-shiki.ts
index 7bb944ce6..d4620194c 100644
--- a/packages/integrations/mdx/src/remark-shiki.ts
+++ b/packages/integrations/mdx/src/remark-shiki.ts
@@ -66,7 +66,7 @@ const remarkShiki = async ({ langs = [], theme = 'github-dark', wrap = false }:
// &lt;span class=&quot;line&quot;
// Replace "shiki" class naming with "astro".
- html = html.replace('<pre class="shiki"', `<pre class="astro-code"`);
+ html = html.replace(/<pre class="(.*?)shiki(.*?)"/, `<pre class="$1astro-code$2"`);
// Add "user-select: none;" for "+"/"-" diff symbols
if (node.lang === 'diff') {
html = html.replace(