Uploaded image for project: 'Confluence'
  1. Confluence
  2. CONFLUENCE-262

Weird trailing whitespace in macro parameter values in some conditions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 9.50.2
    • Syntax - XHTML
    • None
    • Unknown

    Description

      When indenting the Confluence XHTML code in a specific way, a space is added to some parameter values under specific conditions.

      Given this situation:

      • A first macro m1 contains an ac:parameter tag contains whitespace(s) at its end
      • m1 is immediately followed by a macro that has an ac:parameter tag

      m1's parameter will end with a space. If m1 is not followed by a macro, of if this macro doesn't have an ac:parameter tag, the space is not there.

      Reproduction case:

        <object class="BodyContent" package="com.atlassian.confluence.core">
          <id name="id">156868656</id>
          <property name="body"><![CDATA[
      <p><ac:structured-macro ac:name="randommacro"><ac:parameter ac:name="randombuggyparam">A </ac:parameter></ac:structured-macro><ac:structured-macro ac:name="anotherrandommacroneededtoreproduce"><ac:parameter ac:name="randomparamneededtoreproduce">v</ac:parameter></ac:structured-macro></p>
      <p><ac:structured-macro ac:name="randommacro"><ac:parameter ac:name="randombuggyparam">A </ac:parameter></ac:structured-macro></p>
      <p><ac:structured-macro ac:name="randommacro"><ac:parameter ac:name="spaceKey"><ri:space ri:space-key="A" /> </ac:parameter></ac:structured-macro><ac:structured-macro ac:name="anotherrandommacroneededtoreproduce"><ac:parameter ac:name="randomparamneededtoreproduce">v</ac:parameter></ac:structured-macro></p>
      <p><ac:structured-macro ac:name="randommacro"><ac:parameter ac:name="spaceKey"><ri:space ri:space-key="A" /> </ac:parameter></ac:structured-macro></p>
          ]]></property>
          <property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">45809845</id></property>
          <property name="bodyType">2</property>
        </object>
      

      Actual:

      {{randommacro randombuggyparam="A "/}}{{anotherrandommacroneededtoreproduce randomparamneededtoreproduce="v"/}}
      
      {{randommacro randombuggyparam="A"/}}
      
      {{randommacro spaceKey="A "/}}{{anotherrandommacroneededtoreproduce randomparamneededtoreproduce="v"/}}
      
      {{randommacro spaceKey="A"/}}
      

      Expected:

      {{randommacro randombuggyparam="A"/}}{{anotherrandommacroneededtoreproduce randomparamneededtoreproduce="v"/}}
      
      {{randommacro randombuggyparam="A"/}}
      
      {{randommacro spaceKey="A"/}}{{anotherrandommacroneededtoreproduce randomparamneededtoreproduce="v"/}}
      
      {{randommacro spaceKey="A"/}}
      

      We have not seen Confluence generate such an input, which makes the bug minor, but this is still a bit concerning.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rjakse Raphaƫl Jakse
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: