mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 19:01:47 +08:00
17 lines
451 B
JavaScript
17 lines
451 B
JavaScript
export function htmlNormalizer(htmlInput) {
|
|
let str = htmlInput;
|
|
// Some tags have not been normalized across browsers in `Coral RTE` yet.
|
|
// So we'll do this manual step here for now.
|
|
|
|
// Harmonize all to <b> tag.
|
|
str = str
|
|
.replace(/<strong>/g, '<b>') // IE
|
|
.replace(/<\/strong>/g, '</b>'); // IE
|
|
|
|
// Harmonize all to <i> tag.
|
|
str = str
|
|
.replace(/<em>/g, '<i>') // IE
|
|
.replace(/<\/em>/g, '</i>'); // IE
|
|
return str;
|
|
}
|