You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve tag boundary detection for attr-no-duplication fix
Introduces robust functions to find tag boundaries and tag ends, properly handling quotes and edge cases in HTML. Updates the attr-no-duplication autofix logic to use these new functions, improving reliability when detecting and removing duplicate attributes.
@@ -1828,10 +1895,14 @@ function createAttrNoDuplicationFix(
1828
1895
if(existing.value===attr.value){
1829
1896
// Values are the same, we can safely remove the duplicate
1830
1897
duplicatesToRemove.push(attr);
1831
-
trace(`[DEBUG] createAttrNoDuplicationFix: Found duplicate ${attr.name}="${attr.value}" to remove`);
1898
+
trace(
1899
+
`[DEBUG] createAttrNoDuplicationFix: Found duplicate ${attr.name}="${attr.value}" to remove`,
1900
+
);
1832
1901
}else{
1833
1902
// Values are different, don't autofix
1834
-
trace(`[DEBUG] createAttrNoDuplicationFix: Found duplicate ${attr.name} with different values: "${existing.value}" vs "${attr.value}" - not autofixing`);
1903
+
trace(
1904
+
`[DEBUG] createAttrNoDuplicationFix: Found duplicate ${attr.name} with different values: "${existing.value}" vs "${attr.value}" - not autofixing`,
1905
+
);
1835
1906
returnnull;
1836
1907
}
1837
1908
}else{
@@ -1873,10 +1944,12 @@ function createAttrNoDuplicationFix(
1873
1944
start: document.positionAt(startPos),
1874
1945
end: document.positionAt(endPos),
1875
1946
},
1876
-
newText: '',
1947
+
newText: "",
1877
1948
});
1878
1949
1879
-
trace(`[DEBUG] createAttrNoDuplicationFix: Will remove "${text.substring(startPos,endPos)}"`);
1950
+
trace(
1951
+
`[DEBUG] createAttrNoDuplicationFix: Will remove "${text.substring(startPos,endPos)}"`,
1952
+
);
1880
1953
}
1881
1954
1882
1955
if(edits.length===0){
@@ -1889,9 +1962,10 @@ function createAttrNoDuplicationFix(
0 commit comments