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

Different treatment for htmlSafe in fastboot #199

Open
sdhull opened this issue Oct 24, 2018 · 0 comments
Open

Different treatment for htmlSafe in fastboot #199

sdhull opened this issue Oct 24, 2018 · 0 comments
Labels

Comments

@sdhull
Copy link

sdhull commented Oct 24, 2018

Reproduction:

// app/components/example-thing.js
  exampleCss: computed(function() {
    return [htmlSafe('.test > .thing'), ' { background-color: red; }'].join('\n');
  }),
{{!--  app/templates/components/example-thing.hbs  --}}
<style>{{exampleCss}}</style>
<div class='test'>
  <span class='thing'>hi hi hi</span>
</div>

(then of course render this component in your index template or application layout)

Expected:
The div .thing should have text 'hi hi hi' and red background, even with js turned off.

Actual:
The div .thing has a red background with js turned on (after app has initialized in the browser) but no red background with js turned off. The CSS selector gets escaped by fastboot (transforming > into &gt;) while it does not get escaped by ember-in-the-browser.

@xg-wang xg-wang added the bug label Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants