Skip to content

Commit ea8b0e4

Browse files
author
W Hörchner
committed
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 453f40b commit ea8b0e4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)