Skip to content

Commit b08ce46

Browse files
W Hörchnermartinnormark
authored andcommitted
With an All (*) selector in the stylesheet, the css rule is also applied to the html element, head element and elements in the head like script, link etc.
To avoid this behaviour only the elements from the body (and itself) are selected to be matched.
1 parent 81693ce commit b08ce46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PreMailer.Net/PreMailer.Net/PreMailer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ private Dictionary<IElement, List<StyleClass>> FindElementsWithStyles(
405405
Selector = selectorParser.ParseSelector(x.Value.Name)
406406
}).Where(x => x.Selector != null).ToList();
407407

408-
foreach (var el in _document.DescendentsAndSelf<IElement>())
408+
foreach (var el in _document.Body.DescendentsAndSelf<IElement>())
409409
{
410410
foreach (var style in styles)
411411
{

0 commit comments

Comments
 (0)