juice
juice copied to clipboard
Fix ignoredPseudos array
Fix ignoredPseudos array. If css contain selector like ".link-wrapper" juice ignored this selector and doesn't remove style tag. Use pseudos with colon, like ":link"
@pkhodakovsky can you post some example code showing this or explain a little more? I'm not following.
Hi It's still happening, here's the example;
Slightly modified file test/cases/juice-content/pseudo-selector-preserve.html:
<html>
<head>
<style>
a:hover {
color: red;
}
a:active {
color: red;
}
a:focus {
color: red;
}
a:visited {
color: red;
}
a:link {
color: red;
}
a.my-link {
background: green;
}
</style>
</head>
<body>
<a class="my-link" href="#">hover me</a>
</body>
</html>
should produce test/cases/juice-content/pseudo-selector-preserve.out:
<html>
<head>
<style>
a:hover {
color: red;
}
a:active {
color: red;
}
a:focus {
color: red;
}
a:visited {
color: red;
}
a:link {
color: red;
}
</style>
</head>
<body>
<a class="my-link" href="#" style="background: green;">hover me</a>
</body>
</html>
but it produces:
<html>
<head>
<style>
a:hover {
color: red;
}
a:active {
color: red;
}
a:focus {
color: red;
}
a:visited {
color: red;
}
a:link {
color: red;
}
a.my-link {
background: green;
}
</style>
</head>
<body>
<a class="my-link" href="#" style="background: green;">hover me</a>
</body>
</html>
Effectively preserving
a.my-link {
background: green;
}
from being removed from the <style> tag.