import {
checkboxHtmlForTiptap,
checkboxHtmlFromTiptap,
} from './checkboxHtmlNormalizer';
export function prepareHtmlForTiptap(html: string): string {
html = checkboxHtmlForTiptap(html);
html = html.replace(/
/gi, '
wrappers inside
text
(.*?)<\/p><\/li>/gs, '
<\/p>/g, '
');
// Convert tags to self-closing tags
html = html.replace(/
]*)>/gi, (_, attrs: string) => {
if (attrs.trimEnd().endsWith('/')) {
return `
`;
}
return `
`;
});
return `${html}`;
}