Skip to content

Tag and attribute casing incorrectly lowercased in email HTML #832

@LuisUrrutia

Description

@LuisUrrutia

When working with HTML for emails, there are some quirks—especially due to Microsoft’s legacy rendering engines (e.g., Outlook using Word). As a result, valid email HTML often includes conditional comments and XML namespaces, such as:

<!--[if mso]>
<noscript>
  <xml>
    <o:OfficeDocumentSettings>
      <o:PixelsPerInch>96</o:PixelsPerInch>
    </o:OfficeDocumentSettings>
  </xml>
</noscript>
<![endif]-->

However, this gets transformed into:

<!--[if mso]><noscript><xml><o:officedocumentsettings><o:pixelsperinch>96</o:pixelsperinch></o:officedocumentsettings></xml></noscript><![endif]-->

The casing of tags and attributes inside the xml block is being incorrectly lowercased, which breaks compatibility with Outlook. I would expect the output to preserve the original casing, like this:

<!--[if mso]><noscript><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml></noscript><![endif]-->

Would it be possible to prevent this lowercasing behavior, or allow casing to be preserved in specific blocks like this one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions