Skip to content

DOCTYPE statement with external identifier getting trimmed to <DOCTYPE html> #130

@JustasStarred

Description

@JustasStarred

It seems that inline-css is truncating the "external identifier" part of DOCTYPE.

Consider this example

const inlineCss = require('inline-css')
inlineCss(
  '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html></html>',
  { url:'file://test.html' }
).then(console.debug)
// <!DOCTYPE html><html><head></head><body></body></html>

Versions:

Node: v20.12.0
inline-css: 4.0.2

While browsers ignore most parts of DOCTYPE, this may be relevant for emails. I suspect this comes from Cheerio, but since inline-css puts more focus on emails, figured it may be more relevant to ask here. Is this the expected behavior?

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