File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,17 @@ export function truncateElement(element) {
6666 if ( str . length < maxLen ) {
6767 let attrString = '' ;
6868 for ( const { name, value } of elementNodeMap ) {
69+ // Skip data-percy- attributes
70+ if ( name . startsWith ( 'data-percy-' ) ) {
71+ console . log (
72+ `Skipping attribute ${ name } for element ${ nodeName } in truncateElement`
73+ ) ; // Debug log
74+ continue ;
75+ } else {
76+ console . log (
77+ `Including attribute ${ name } for element ${ nodeName } in truncateElement`
78+ ) ;
79+ }
6980 const attr = { name, value } ;
7081 attrString += ` ${ attr . name } ="${ attr . value } "` ;
7182 }
@@ -80,6 +91,18 @@ export function truncateElement(element) {
8091 break ;
8192 }
8293
94+ // Skip data-percy- attributes
95+ if ( name . startsWith ( 'data-percy-' ) ) {
96+ console . log (
97+ `Skipping attribute ${ name } for element ${ nodeName } in truncateElement`
98+ ) ; // Debug log
99+ continue ;
100+ } else {
101+ console . log (
102+ `Including attribute ${ name } for element ${ nodeName } in truncateElement`
103+ ) ;
104+ }
105+
83106 const attr = { name, value } ;
84107 let attrName = attr . name ;
85108 let attrValue = attr . value ;
You can’t perform that action at this time.
0 commit comments