Skip to content

Commit 16fa42a

Browse files
authored
Merge pull request #563 from cossssmin/master
fix: ignorePseudos selector matching
2 parents 6164b12 + ee81959 commit 16fa42a

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

lib/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ exports.normalizeLineEndings = function(text) {
116116

117117
exports.matchesPseudo = function(needle, haystack) {
118118
return haystack.find(function (element) {
119-
return needle.indexOf(element) > -1;
119+
return needle.indexOf(':' + element) > -1;
120120
})
121121
}
122122

test/cases/juice-content/pseudo-selector-preserve.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
a:link {
1717
color: red;
1818
}
19+
a.my-link {
20+
color: blue;
21+
}
1922
</style>
2023
</head>
2124
<body>
22-
<a href="#">hover me</a>
25+
<a class="my-link" href="#">hover me</a>
2326
</body>
2427
</html>

test/cases/juice-content/pseudo-selector-preserve.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ a:link {
1919
</style>
2020
</head>
2121
<body>
22-
<a href="#">hover me</a>
22+
<a class="my-link" href="#" style="color: blue;">hover me</a>
2323
</body>
24-
</html>
24+
</html>

0 commit comments

Comments
 (0)