mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-06-29 07:59:40 +02:00
8 lines
248 B
TypeScript
8 lines
248 B
TypeScript
|
const cleanHeaders = (html: string): string => {
|
||
|
return html.replace(
|
||
|
/<h([0-9])>(.*?)(\{#.*?<\/?em>.*?})/g,
|
||
|
(_, level, title, tag) => `<h${level}>${title} ${tag.replace(/<\/?em>/g, '_')}`
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default cleanHeaders;
|