davidmerfield / davidmerfield/Typeset

Typeset removing closing slash on void (singleton) elements

Open
#71 4 comments 0 reactions 1 assignee Claimed by @danielhaim1 View on GitHub
bug
Dominant language
JavaScript
Stars
2.7k
Forks
53
PR merge metrics
No merged PRs in 30d

Description

[Void elements](https://w3c.github.io/html-reference/syntax.html#syntax-elements), or singletons, like `img`, `hr`, `br` and others contain a closing forward slash in (X)HTML validation, e.g. ``.

When Typeset processes content with HTML, it is removing those closing slashes, e.g. rendering the above as ``.

Closing slashes are of course optional, but:

a) I don't think Typeset should be messing with tag syntax in the first place.
b) In HTML emails, using closing slashes is recommended for cross-email compatibility in all their crappy rendering engines.
c) In my case, I'm using MJML, which uses void/singleton elements for things like [`mj-image`](https://documentation.mjml.io/#mj-image) -- and in that case a tag without a closing slash isn't valid.

My specific use might be an edge case, but I'm sure I'm not the only one formatting HTML emails.

Can Typeset avoid changing HTML tags?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.