feat: in case of no html, dont mutate

This commit is contained in:
Nevo David 2025-07-16 22:21:36 +07:00
parent f077d99049
commit 4907bb3572
1 changed files with 4 additions and 0 deletions

View File

@ -134,6 +134,10 @@ export const stripHtmlValidation = (
value: string,
replaceBold = false
): string => {
if (value.indexOf("<p>") === -1) {
return value;
}
const html = (value || '')
.replace(/&nbsp;/gi, ' ')
.replace(/^<p[^>]*>/i, '')