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

Style tag get stripped from riot tag even if it's in a javascript string #2210

Closed
1 of 7 tasks
josephrocca opened this issue Jan 11, 2017 · 3 comments
Closed
1 of 7 tasks
Assignees

Comments

@josephrocca
Copy link

josephrocca commented Jan 11, 2017

  1. Describe your issue:

This:

<script>
  let myStyle = "<style> body { margin:0; padding:0; color: green; font-family:monospace; } </style>";
</script>

compiles to this:

<script>
  let myStyle = "";
</script>

(in terms of the script part of the tag only)

Very surprising behaviour! I hope the new parser fixes this. Either there's some very naive regex happening in riot at the moment, or I've really messed up somewhere.

Current workaround is this sort of thing:

let myStyle = "<"+"style"+">"+"body { margin:0; padding:0; color: green; font-family:monospace; }"+"<"+"/style"+">"; // (lol)
  1. Can you reproduce the issue?

http://plnkr.co/edit/tBorIw281jZs3zwDvmgC?p=preview

  1. On which browser/OS does the issue appear?
    Chrome, Ubuntu, at least

  2. Which version of Riot does it affect?
    Riot 3.0.5 at least

  3. How would you tag this issue?

  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@aMarCruz
Copy link
Contributor

@GianlucaGuarini , fix is in the dev brach of riot-compiler

@GianlucaGuarini
Copy link
Member

thanks @aMarCruz could you please publish a new release?

@aMarCruz
Copy link
Contributor

@GianlucaGuarini riot-compiler v3.1.2 is up.
Closing this issue.

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

No branches or pull requests

3 participants