Skip to content
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

Rehydration is adding placeholders tags to the head title tag #796

Closed
kiwiupover opened this issue Apr 9, 2018 · 5 comments · Fixed by #961
Closed

Rehydration is adding placeholders tags to the head title tag #796

kiwiupover opened this issue Apr 9, 2018 · 5 comments · Fixed by #961

Comments

@kiwiupover
Copy link
Contributor

kiwiupover commented Apr 9, 2018

<title><!--%+b:9%-->RV Rentals from the Most Trusted RV Owners | Outdoorsy<!--%-b:9%--></title>

https://cl.ly/1r3h03190G3x

@rwjblue
Copy link
Member

rwjblue commented Apr 9, 2018

Discussed in chat with @kiwiupover, basically the serialization format for:

{{#in-element headElement}}
  <title>{{someDynamicThing}}</title>
{{/in-element}}

Ends up emitting something like:

<title><!--%+b:9%-->Some Content<!--%-b:9%--></title>

And for <title> literally any content present is what will be the title of the tab/window (small demo here).

@rwjblue
Copy link
Member

rwjblue commented Apr 9, 2018

As a test, I suggested trying:

{{{somethingWithTitleTagIncluded}}}

Which might force the rendering engine to emit the comment nodes around the title tag (but not inside of it). Obviously, this work around has a number of other significant trade offs but it seemed reasonable to try...

@krisselden
Copy link
Contributor

rehydration in the rcdata state https://dev.w3.org/html5/spec-preview/tokenization.html#rcdata-end-tag-name-state is always going to have this issue

@kiwiupover
Copy link
Contributor Author

kiwiupover commented Apr 13, 2018

@rwjblue work around works just fine.

{{{somethingWithTitleTagIncluded}}}

https://www.outdoorsy.com

@rwjblue Should I add this to some docs of is there a fix to this like there is for a textarea?

@CvX
Copy link
Contributor

CvX commented Jun 28, 2019

I think the following should be prefaced with:
I have no idea what I’m doing dog meme


As I mentioned in ember-fastboot/ember-cli-fastboot#659 (comment), here’s a work-in-progress fix for invalid <title>, <style>, and <script> tags when used with EXPERIMENTAL_RENDER_MODE_SERIALIZE:

simple-html-tokenizer:
Draft PR: tildeio/simple-html-tokenizer#69
Treats all contents of those element as text content.

glimmer-vm:
master...CvX:fix-rehydration
Prevents adding the rehydration comments in those elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants