Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-4177

Sightly: StyleString context doesn't properly escape

    XMLWordPrintableJSON

Details

    Description

      The context='styleString' expression option seems to escape strings the same way as context='scriptString', but this breaks the string, making that context unusable. CSS strings are to be escaped \HH and not \xHH like in JS:
      https://developer.mozilla.org/en-US/docs/Web/CSS/string

      Consider following example:

      <style>
      .ft:after { content: "${'\'' @ context='styleString'}"; }
      .in:after { content: "${'\"' @ context='styleString'}"; }
      </style>
      

      Which currently gets incorrectly rendered as follows:

      <style>
      .ft:after { content: "\x27"; }
      .in:after { content: "\x22"; }
      </style>
      

      Following output would have been expected:

      <style>
      .ft:after { content: "\27"; }
      .in:after { content: "\22"; }
      </style>
      

      Attachments

        Activity

          People

            fmeschbe Felix Meschberger
            vladb Vlad Bailescu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: