Skip to content

Commit 32c72ce

Browse files
committed
Address feedbacks
1 parent 3142ead commit 32c72ce

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/js/_enqueues/wp/sanitize.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
* @return {string} Stripped text.
2424
*/
2525
stripTags: function( text ) {
26-
let _text = text || '';
2726

2827
const domParser = new DOMParser();
2928
const htmlDocument = domParser.parseFromString(
30-
_text,
29+
text,
3130
'text/html'
3231
);
3332

@@ -40,7 +39,7 @@
4039
*
4140
* See: https://github.com/WordPress/wordpress-develop/pull/10536#discussion_r2550615378
4241
*/
43-
htmlDocument.body.innerText = htmlDocument.body.innerText || '';
42+
htmlDocument.body.innerText = htmlDocument.body.innerText;
4443

4544
// Return the text with stripped tags.
4645
return htmlDocument.body.innerHTML;

0 commit comments

Comments
 (0)