Riot: Style tag get stripped from riot tag even if it's in a javascript string

Created on 11 Jan 2017  路  3Comments  路  Source: riot/riot

  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

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

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

  4. How would you tag this issue?

    • [ ] Question
    • [x] Bug
    • [ ] Discussion
    • [ ] Feature request
    • [ ] Tip
    • [ ] Enhancement
    • [ ] Performance
bug fixed

Most helpful comment

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

All 3 comments

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

thanks @aMarCruz could you please publish a new release?

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SatoshiKawabata picture SatoshiKawabata  路  3Comments

chrisk314 picture chrisk314  路  3Comments

syuilo picture syuilo  路  3Comments

vogloblinsky picture vogloblinsky  路  3Comments

GianlucaGuarini picture GianlucaGuarini  路  3Comments