From 25ed26cc268dc19ede787d1e09b118c1a3235ec0 Mon Sep 17 00:00:00 2001 From: Shir Serlui <70711723+shirser121@users.noreply.github.com> Date: Tue, 6 Feb 2024 21:55:43 +0200 Subject: [PATCH] Fix delete text inside elements --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index f1e736f..f7142f3 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -3,7 +3,7 @@ const entities = require('entities'); const xml2js = require('xml2js'); utils.stripHtml = function(str) { - str = str.replace(/([^\n])<\/?(h|br|p|ul|ol|li|blockquote|section|table|tr|div)(?:.|\n)*?>([^\n])/gm, '$1\n$3') + str = str.replace(/<\/?(h|br|p|ul|ol|li|blockquote|section|table|tr|div)(?:.|\n)*?>/gm, '\n'); str = str.replace(/<(?:.|\n)*?>/gm, ''); return str; }