JBehave
  1. JBehave
  2. JBEHAVE-705

decorated txt reports get broken if the text contains <script></script> tags

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.4
    • Fix Version/s: 3.6
    • Component/s: Core
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      0

      Description

      When text reports contains script tags (the closing </script> to be exact), the decorator breaks since the browser parses the script tags before the CDATA xml tag.

      E.g. if you have a step like:

      When I enter <script>test();</script>
      Then something else

      the resulting _txt.html file looks like this:

      <script type="syntaxhighlighter" class="brush: text"><![CDATA[
      When I enter <script>test();</script>
      Then something else
      ]]></script>

      the browser will stop parsing the script tag at the first </script>.

      the fix changes the CDATA tag to html encoding if the text contains </script>, in all other cases wrapping the text in CDATA is correct.

        Activity

        Show
        Alexander Lehmann added a comment - https://github.com/alexlehm/jbehave-core/commit/07af4bebd7dbfcdc3116e9ab728769346c20ac73
        Hide
        Mauro Talevi added a comment -

        Pulled with thanks.

        Show
        Mauro Talevi added a comment - Pulled with thanks.
        Mauro Talevi made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 3.6 [ 17721 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Mauro Talevi
            Reporter:
            Alexander Lehmann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: