From 2f1c72199637c98d8213a8c8097983bc79a6fd8b Mon Sep 17 00:00:00 2001 From: Leilukin Date: Tue, 7 May 2024 09:50:08 +0800 Subject: [PATCH] Remove empty

tags before and after accordions when paired together in shortcodes --- eleventy.config.md.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eleventy.config.md.js b/eleventy.config.md.js index 8be1f403..cdf9d80f 100644 --- a/eleventy.config.md.js +++ b/eleventy.config.md.js @@ -81,14 +81,13 @@ module.exports = function (eleventyConfig) { // Paired shorcode: Spoiler accordion eleventyConfig.addPairedShortcode('spoiler', (content, hint) => { + content = content.trim(); const hintMarkUp = markdownLibrary.renderInline(hint); const contentMarkup = markdownLibrary.render(content); - return ` -

+ return `
${hintMarkUp}
${contentMarkup}
-
- `; +
`; }); /* This is the part that tells 11ty to swap to our custom config */