-
Notifications
You must be signed in to change notification settings - Fork 962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elements intended to contain plain text shouldn't include leading/trailing space #2443
Comments
Really weird that we have this issue only on those two tags. Looks to be related to beautify ? |
It could be happening on other tags too, but as I said it wouldn't generally matter if the tag contains content that is wrapped in HTML. e.g. if it ends up generating |
There's no actual reason to have this whitespace anyway, i'll check if we can do something about this. |
Looks fixed finally in latest version 😄 |
Describe the bug
When using elements intended to contain only plain text -- like
<mj-title>
and<mj-preview>
-- a space is prepended and appended to the text. In some cases (such as a rendered<title>
tag in a client's browser window) this space can be noticeable.To Reproduce
This is visible on the docs' Try It Live for both
<mj-title>
and<mj-preview>
, but here's one that shows both:https://mjml.io/try-it-live/qvxPFIRrv
View the HTML and then look at the
<title>
tag and further down the<div style="display:none...
line.Expected behavior
For MJML elements that are intended to contain only plain text -- I think it's just
<mj-title>
and<mj-preview>
, but maybe also<mj-raw>
in some situations? -- no spaces should be added before or after the contents. For other elements which typically wrap HTML tags, it's not necessary (and also usually collapsed by client rendering anyway).If the space is for some reason desired in some situations, it would be nice to have attributes on these elements to optionally prevent it. Something like
spaceless="true"
orwhitespace="none"
.MJML environment (please complete the following information):
The text was updated successfully, but these errors were encountered: