Skip to content

Commit

Permalink
🎨 Support details/summary in HTML (#1158)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 authored Apr 24, 2024
1 parent 3665fa1 commit 9a30092
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/witty-dodos-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"myst-transforms": patch
"myst-cli": patch
---

Support details/summary in HTML
7 changes: 7 additions & 0 deletions packages/myst-transforms/src/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ const defaultHtmlToMdastOptions: Record<keyof HtmlTransformOptions, any> = {
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));
},
},
};

Expand Down

0 comments on commit 9a30092

Please sign in to comment.