From eea70f552073eafbdab5cffab1a796d40b67a41d Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Wed, 24 Apr 2024 07:30:11 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Support=20details/summary=20in?= =?UTF-8?q?=20HTML?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See executablebooks/jupyterlab-myst#232 --- .changeset/witty-dodos-guess.md | 6 ++++++ packages/myst-transforms/src/html.ts | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 .changeset/witty-dodos-guess.md diff --git a/.changeset/witty-dodos-guess.md b/.changeset/witty-dodos-guess.md new file mode 100644 index 000000000..b9ecf8c5c --- /dev/null +++ b/.changeset/witty-dodos-guess.md @@ -0,0 +1,6 @@ +--- +"myst-transforms": patch +"myst-cli": patch +--- + +Support details/summary in HTML diff --git a/packages/myst-transforms/src/html.ts b/packages/myst-transforms/src/html.ts index 39134b284..5eea6b535 100644 --- a/packages/myst-transforms/src/html.ts +++ b/packages/myst-transforms/src/html.ts @@ -137,6 +137,13 @@ const defaultHtmlToMdastOptions: Record = { const attrs = addClassAndIdentifier(node); return attrs.label ? h(node, 'cite', attrs, all(h, node)) : all(h, node); }, + details(h: H, node: any) { + const attrs = addClassAndIdentifier(node); + return h(node, 'details', attrs, all(h, node)); + }, + summary(h: H, node: any) { + return h(node, 'summary', all(h, node)); + }, }, };