inky icon indicating copy to clipboard operation
inky copied to clipboard

xhtml self closing tags

Open rogervila opened this issue 8 years ago • 6 comments

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.

rogervila avatar Mar 23 '16 14:03 rogervila

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

gakimball avatar Mar 23 '16 16:03 gakimball

@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.

rafibomb avatar Jun 08 '16 17:06 rafibomb

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?

EarthlingDavey avatar Oct 04 '17 16:10 EarthlingDavey

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 avatar Mar 02 '18 23:03 liayn

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

.pipe(inky({
	cheerio: {
		xmlMode: true,
		lowerCaseAttributeNames: false
	}
}))

liayn avatar Mar 03 '18 00:03 liayn

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.

brosig avatar Nov 20 '20 00:11 brosig