We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3142ead commit 32c72ceCopy full SHA for 32c72ce
src/js/_enqueues/wp/sanitize.js
@@ -23,11 +23,10 @@
23
* @return {string} Stripped text.
24
*/
25
stripTags: function( text ) {
26
- let _text = text || '';
27
28
const domParser = new DOMParser();
29
const htmlDocument = domParser.parseFromString(
30
- _text,
+ text,
31
'text/html'
32
);
33
@@ -40,7 +39,7 @@
40
39
*
41
* See: https://github.com/WordPress/wordpress-develop/pull/10536#discussion_r2550615378
42
43
- htmlDocument.body.innerText = htmlDocument.body.innerText || '';
+ htmlDocument.body.innerText = htmlDocument.body.innerText;
44
45
// Return the text with stripped tags.
46
return htmlDocument.body.innerHTML;
0 commit comments