Skip to content

Commit

Permalink
fix: revert unwrapping callout-body for single node
Browse files Browse the repository at this point in the history
  • Loading branch information
naiyerasif committed Feb 21, 2024
1 parent 6afa4d6 commit 5b0e713
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 31 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ export default function remarkCalloutDirectives(userOptions = {}) {
class: "class" in attributes ? `callout callout-${calloutType} ${attributes.class}` : `callout callout-${calloutType}`
};

const children = !!node.children && node.children.length === 1 ?
node.children[0].children : node.children;
node.children = generate(title || callout.title, children, callout.hint);
node.children = generate(title || callout.title, node.children, callout.hint);

const tagName = callout.tagName || options.tagName || "aside";
const hast = h(tagName, node.attributes);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@microflash/remark-callout-directives",
"version": "4.0.0",
"version": "4.1.0",
"description": "remark plugin to render callouts and admonitions with directives",
"license": "MIT",
"keywords": [
Expand Down
Loading

0 comments on commit 5b0e713

Please sign in to comment.