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

Closed
josephrocca opened this Issue Jan 11, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@josephrocca

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

@GianlucaGuarini GianlucaGuarini added invalid bug and removed invalid labels Jan 12, 2017

aMarCruz referenced this issue in riot/compiler Jan 22, 2017

@aMarCruz

This comment has been minimized.

Show comment
Hide comment
@aMarCruz

aMarCruz Jan 22, 2017

Member

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

Member

aMarCruz commented Jan 22, 2017

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

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Jan 22, 2017

Member

thanks @aMarCruz could you please publish a new release?

Member

GianlucaGuarini commented Jan 22, 2017

thanks @aMarCruz could you please publish a new release?

@aMarCruz

This comment has been minimized.

Show comment
Hide comment
@aMarCruz

aMarCruz Jan 22, 2017

Member

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

Member

aMarCruz commented Jan 22, 2017

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

@aMarCruz aMarCruz closed this Jan 22, 2017

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