Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Node 18 Whitespace + Self-closing Tags #1941

Closed
mcblum opened this issue May 16, 2023 · 3 comments
Closed

Node 18 Whitespace + Self-closing Tags #1941

mcblum opened this issue May 16, 2023 · 3 comments

Comments

@mcblum
Copy link

mcblum commented May 16, 2023

Hello!

We're in the process of upgrading our app to use Node 18. When I did the upgrade, all of the tests failed. Looking into it, it looks like there's some difference where all of the whitespace is being collapsed and the self-closing tags stripped out. So <meta /> is becoming <meta>.

I see some recent commits for testing with Node 18, but I'm wondering if it's fully supported or if anyone else has seen this?

Thanks!

@jaylinski
Copy link
Member

jaylinski commented May 16, 2023

Hm... the tests seem to run fine, even with Node 20:

https://github.com/handlebars-lang/handlebars.js/actions/runs/4997611619/jobs/8952151271

Also: it would be weird if the Node version somehow had influence on how Handlebars handles whitespace.

Did you upgrade handlebars or did it stay the same in your lock-file?

@mcblum
Copy link
Author

mcblum commented May 17, 2023

@jaylinski I thought the same thing! I did not, it stayed exactly the same in the lockfile, as did all its dependencies. That was surprising to me. I did learn that actually the HTML5 spec does not require self-closing tags because it considers those elements "void", but there are a couple other strange things happening, too, like the CSS color hex codes are being transformed to all uppercase. Something is definitely weird, but I can't seem to figure out why.

@jaylinski
Copy link
Member

Maybe there is another post- or pre-processing step in your setup that now changes your rendered HTML?

@handlebars-lang handlebars-lang locked and limited conversation to collaborators May 23, 2023
@jaylinski jaylinski converted this issue into discussion #1943 May 23, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants