JBehave
  1. JBehave
  2. JBEHAVE-674

HTML decoration marks parameters twice

    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
    • Number of attachments :
      2

      Description

      Following up on JBEHAVE-656, this works now correctly for empty strings.
      However all other parameters are enclosed in a span twice if an example table is used (this was present in 3.5.4 as well).

      Apparently the parameters are marked once using the name enclosed in angle brackets and then once more by string replace, by the function that is used for normal steps as well.

      This doesn't cause any change is the HTML display, so it's not a very big problem (the xml looks odd however since the parameter tag appears twice).

        Activity

        Hide
        Alexander Lehmann added a comment -

        Come to think of it, the replacement probably takes place in the wrong order, first the table parameter names are replace by the parameters and second the parameters are replace once again by the operation for normal parameters. If this is done the other way round, it should work correctly.

        Show
        Alexander Lehmann added a comment - Come to think of it, the replacement probably takes place in the wrong order, first the table parameter names are replace by the parameters and second the parameters are replace once again by the operation for normal parameters. If this is done the other way round, it should work correctly.
        Hide
        Mauro Talevi added a comment -

        Can you please provide an example riproducing this behaviour?

        Show
        Mauro Talevi added a comment - Can you please provide an example riproducing this behaviour?
        Mauro Talevi made changes -
        Field Original Value New Value
        Assignee Mauro Talevi [ maurotalevi ]
        Fix Version/s 3.6 [ 17721 ]
        Affects Version/s 3.5.4 [ 18081 ]
        Affects Version/s 3.6 [ 17721 ]
        Hide
        Alexander Lehmann added a comment -

        example project

        Show
        Alexander Lehmann added a comment - example project
        Alexander Lehmann made changes -
        Attachment jbehave674example.zip [ 58253 ]
        Hide
        Alexander Lehmann added a comment -

        the example produces the following html

        <div class="step successful">Given a <span class="step parameter"><span class="step parameter">example</span></span></div>

        Show
        Alexander Lehmann added a comment - the example produces the following html <div class="step successful">Given a <span class="step parameter"><span class="step parameter">example</span></span></div>
        Alexander Lehmann made changes -
        Attachment step.diff [ 58254 ]
        Hide
        Alexander Lehmann added a comment -

        I think I found the bug, see the attached step.diff

        Show
        Alexander Lehmann added a comment - I think I found the bug, see the attached step.diff
        Hide
        Alexander Lehmann added a comment -

        this would probably benefit from a unit test, but I yet have almost no experience in writing unit tests

        Show
        Alexander Lehmann added a comment - this would probably benefit from a unit test, but I yet have almost no experience in writing unit tests
        Hide
        Mauro Talevi added a comment -

        Applied patch. Added unit test to reproduce behaviour.

        Show
        Mauro Talevi added a comment - Applied patch. Added unit test to reproduce behaviour.
        Mauro Talevi made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        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: