We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 09298a2 commit 13fbd82Copy full SHA for 13fbd82
1 file changed
lib/core/utils/dq-element.js
@@ -174,10 +174,10 @@ function getSource(element) {
174
if (!source && typeof window.XMLSerializer === 'function') {
175
source = new window.XMLSerializer().serializeToString(element);
176
}
177
- let htmlString = truncate(source || '');
178
// Remove unwanted attributes
179
- const regex = /\s*data-percy-[^=]+="[^"]*"/g;
180
- htmlString = htmlString.replace(regex, '');
+ const regex = /\s*data-percy-[^=]+="[^"]*"/g; // Remove unwanted attributes
+ source = (source || '').replace(regex, '');
+ const htmlString = truncate(source);
181
return htmlString;
182
183
0 commit comments