Skip to content

Commit

Permalink
fix: improve comment cleanup regex
Browse files Browse the repository at this point in the history
  • Loading branch information
catalan-adobe committed Feb 13, 2024
1 parent 7207ad2 commit 8f1a7cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/DOMUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default class DOMUtils {
// eslint-disable-next-line no-param-reassign
document.body.innerHTML = document.body.innerHTML
// remove html comments
.replace(/><!--(?!>)[\S\s]*?-->/gm, '>')
.replace(/(>\s*)<!--(?!>)[\S\s]*?-->/gm, '$1')
.replace(/\n<!--(?!>)[\S\s]*?-->/gm, '\n');
}

Expand Down

0 comments on commit 8f1a7cd

Please sign in to comment.