inline-css icon indicating copy to clipboard operation
inline-css copied to clipboard

Avoid applying styles to items to HTML, HEAD and items in HEAD

Open jwerre opened this issue 9 years ago • 2 comments

I've got a reset style something like this:

* {
     margin: 0;
     padding: 0;
}

the result is:

<html xmlns="http://www.w3.org/1999/xhtml" style="margin: 0; padding: 0;">
  <head style="margin: 0; padding: 0;">
    <meta name="viewport" content="width=device-width" style="margin: 0; padding: 0;">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" style="margin: 0; padding: 0;">
    <title style="margin: 0; padding: 0;">Actionable email</title>
    <link href="styles.css" media="all" type="text/css" style="margin: 0; padding: 0;">
  </head>

I can't think of any reason why you would want to apply styling to items in the head. It might be a good idea to turn this off by default and allow it to be turned on in the options.

jwerre avatar Mar 18 '16 20:03 jwerre

Should work for the html element imo, but not for non-visible elements like elements in the head element. Maybe the new option could be a black/ignore list of element names.

thasmo avatar Apr 06 '16 08:04 thasmo

I think the best course is to just avoid applying styles to the head altogether. My guess is the parser just doesn't discriminate.

jonkemp avatar Apr 06 '16 14:04 jonkemp