From 6abc965fdd8126d6b27b3a4940eed27227681a27 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 12 Jun 2023 09:12:07 +0200 Subject: Create details special box --- src/build/special_box.mjs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/build/special_box.mjs b/src/build/special_box.mjs index 0b284ec..9321e66 100644 --- a/src/build/special_box.mjs +++ b/src/build/special_box.mjs @@ -18,6 +18,20 @@ export default function specialBox() { className: 'special-box ' + node.name, }; } + if (node.type === 'containerDirective' && node.name === 'details') { + if(node.children.length > 0 && node.children[0].type == "paragraph") { + node.children[0] = { + type: "containerDirective", + data: { + hName: 'summary' + }, + children: node.children[0].children + }; + + const data = node.data || (node.data = {}); + data.hName = 'details'; + } + } }); }; } -- cgit v1.2.3