From 65fb7cf6381faf2da727bc5b68df7783bf672e46 Mon Sep 17 00:00:00 2001 From: grassblock Date: Mon, 18 Aug 2025 18:33:36 +0800 Subject: [PATCH] fix: spoiler display when used as a block --- src/components/shortcodes/Spoiler.astro | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/shortcodes/Spoiler.astro b/src/components/shortcodes/Spoiler.astro index 319f3f6..48b985d 100644 --- a/src/components/shortcodes/Spoiler.astro +++ b/src/components/shortcodes/Spoiler.astro @@ -1,9 +1,17 @@ --- const { tip = '' } = Astro.props +let divNeeded = false +const content = await Astro.slots.render('default') +if (content.includes('
')) {
+ divNeeded = true
+}
+
---
-
-