From 5fde2fd8bcc7f10e8a449146fa89843f6e6b6aa3 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Mon, 18 Jul 2022 16:42:57 -0400 Subject: [PATCH] Moves Debug component's styles to be inlined (#3963) --- .changeset/warm-news-fly.md | 5 ++++ packages/astro/components/Code.astro | 4 +-- packages/astro/components/Debug.astro | 22 ++++++++-------- packages/astro/test/code-component.test.js | 26 +++++++++++++++++++ .../test/fixtures/code-component/package.json | 8 ++++++ .../code-component/src/pages/index.astro | 11 ++++++++ pnpm-lock.yaml | 6 +++++ 7 files changed, 69 insertions(+), 13 deletions(-) create mode 100644 .changeset/warm-news-fly.md create mode 100644 packages/astro/test/code-component.test.js create mode 100644 packages/astro/test/fixtures/code-component/package.json create mode 100644 packages/astro/test/fixtures/code-component/src/pages/index.astro diff --git a/.changeset/warm-news-fly.md b/.changeset/warm-news-fly.md new file mode 100644 index 0000000000..389a39049b --- /dev/null +++ b/.changeset/warm-news-fly.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Makes the Debug component's styles be inlined diff --git a/packages/astro/components/Code.astro b/packages/astro/components/Code.astro index e829f87beb..a2052c8161 100644 --- a/packages/astro/components/Code.astro +++ b/packages/astro/components/Code.astro @@ -36,8 +36,8 @@ const { code, lang = 'plaintext', theme = 'github-dark', wrap = false } = Astro. /** Replace the shiki class name with a custom astro class name. */ function repairShikiTheme(html: string): string { - // Replace "shiki" class naming with "astro" and add "is:raw". - html = html.replace('
-	
-

Debug "{key}"

+
+
+

Debug "{key}"

-