${callouts[canonicalizeCallout(calloutType)]}
${title}
`
}
const blockquoteContent: (BlockContent | DefinitionContent)[] = [titleNode]
if (remainingText.length > 0) {
blockquoteContent.push({
type: 'paragraph',
children: [{
type: 'text',
value: remainingText,
}]
})
}
// replace first line of blockquote with title and rest of the paragraph text
node.children.splice(0, 1, ...blockquoteContent)
// add properties to base blockquote
node.data = {
hProperties: {
...(node.data?.hProperties ?? {}),
className: `callout ${collapse ? "is-collapsible" : ""} ${defaultState === "collapsed" ? "is-collapsed" : ""}`,
"data-callout": calloutType,
"data-callout-fold": collapse,
}
}
}
})
}
})
}
return plugins
},
htmlPlugins() {
return [rehypeRaw]
}
}
}