Skip to content

Commit

Permalink
Fix delete text inside elements
Browse files Browse the repository at this point in the history
  • Loading branch information
shirser121 authored Feb 6, 2024
1 parent a8156ee commit 25ed26c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 25ed26c

Please sign in to comment.