Skip to content

Commit

Permalink
With an All (*) selector in the stylesheet, the css rule is also appl…
Browse files Browse the repository at this point in the history
…ied 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.
  • Loading branch information
W Hörchner committed Feb 2, 2024
1 parent 453f40b commit ea8b0e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PreMailer.Net/PreMailer.Net/PreMailer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ private Dictionary<IElement, List<StyleClass>> FindElementsWithStyles(
Selector = selectorParser.ParseSelector(x.Value.Name)
}).Where(x => x.Selector != null).ToList();

foreach (var el in _document.DescendentsAndSelf<IElement>())
foreach (var el in _document.Body.DescendentsAndSelf<IElement>())
{
foreach (var style in styles)
{
Expand Down

0 comments on commit ea8b0e4

Please sign in to comment.