foundation / inky

Convert a simple HTML syntax into tables compatible with Foundation for Emails.
http://foundation.zurb.com/emails
676 stars 108 forks source link

xhtml self closing tags #18

Open rogervila opened 8 years ago

rogervila commented 8 years ago

Hello,

Since emails are written in XHTML 1.0 Strict, self closing tags should have a slash at the end of the name.

ie: <br> should be <br />

When I compile a file with Inky, the result is written in html5 style (<br>)

If you agree, I can make a pull request that solves this issue.

Thank you.

gakimball commented 8 years ago

See #14 for the potential issue we still need to test.

rafibomb commented 8 years ago

@rogervila We're using the transitional doctype now. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Do you see any reason we need to make the change for this? What were you thinking of changing to solve it.

EarthlingDavey commented 7 years ago

This is kind of a pain, I need to drop in this tag <rssimage width="340"/> for campaign monitor, but Inky is changing it to <rssimage width="340"></rssimage>. Is there a don't parse syntax for inky?

liayn commented 6 years ago

I can only second the previous post. We also use other non-standard tags within the templates and those are converted from self-closing to empty tags. In our case the custom tags are there for another templating engine, hence those have to match what this engine expects.

liayn commented 6 years ago

As noted in #99 I could solve this issue with setting this configuration:

.pipe(inky({
    cheerio: {
        xmlMode: true,
        lowerCaseAttributeNames: false
    }
}))
brosig commented 3 years ago

For me i was dumping it on SpringBoot Thymeleaf. Every time i was building i had to include the closing slash for selfclosing tags (meta, link, etc). With @liayn suggestion it works like a charm. Thanks.