/** * Removes the paragraph tags from around callout blocks so they end up being valid HTML * * @param html * @returns */ const cleanCalloutTags = (html: string): string => { // Replace callout
tags with a \s*\[(hint|warning|info|alert|notice|note)\](.*?)\[\/\1\]\s*<\/p>/gs,
(_, type, content) => ` and tags.
return html.replace(
/ |<\/p>)/g, '
, since the above operation may have
// inadvertantly broken some
')
);
};
export default cleanCalloutTags;