Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-8756

HTML markup created from {table}{table-row}{table-cell} inserts extra <TD/>'s which interfere with macro-generated HTML contained in tables, unless SnipSnap compatibility macro is disabled.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 2.9
    • 2.3.3, 2.5.7
    • None

      Background: the edit-include macro (see CONFEXT:edit-include user macro) generates html code that contains a style override, that might look like this:

      <style type="text/css">
      <!--
      span.editlink { float:right;position:relative; font-size:0.8em; }
      span.editlink span { position:relative; top:0px; right:0px; border:1px solid #DDE; background-color:#EEE}
      span.editlink span a { text-decoration:none; font-weight:bold; }
      span.editlink span a:hover { background-color:#CFCFDF }
      // -->
      </style>
      <span class="editlink">
      <span>
      ${xhtmlEdit}
      </span>
      </span>
      

      When this macro is used on a page in a table using wiki markup, everything is fine. If the table is defined using

      {table}

      macro set, extra <TD>....</td> tags are inserted for each 'newline' in the above 'style', effectively interfering with the html style declaration. For example this wiki code generates the following HTML. A and B are NOT equivalent to each other: They should be equivalent, or at least, not interrupted with extra <TD>'s.

      (note: replace the ()'s with {}'s, but for some reason these don't work for table elements in noformat blocks!!!!!)

      h1.  A
      (table:border=0)(table-row)(table-cell)
      (edit-include:subpage)(table-cell)(table-row)(table)
      
      h1. B
       | {edit-include:subpage} |
      

      Generated html A:

      <h1><a name="edit-include-A"></a>A</h1>
      <table class="wiki-table" cellpadding="0" cellspacing="0" bo
      rder="0"><tr><th><tr><td></th></tr><tr class="table-odd"><td
      ><style type="text/css"></td></tr><tr class="table-even"><td
      ><!--</td></tr><tr class="table-odd"><td>span.editlink {</td
      ></tr><tr class="table-even"><td>float:right;position:relati
      ve;</td></tr><tr class="table-odd"><td>font-size:0.8em;</td>
      </tr><tr class="table-even"><td>}</td></tr><tr class="table-
      odd"><td>span.editlink span {</td></tr><tr class="table-even
      "><td>position:relative;</td></tr><tr class="table-odd"><td>
      top:0px;</td></tr><tr class="table-even"><td>right:0px;</td>
      </tr><tr class="table-odd"><td>border:1px solid #DDE;</td></
      tr><tr class="table-even"><td>background-color:#EEE}</td></t
      r><tr class="table-odd"><td>span.editlink span a {</td></tr>
      <tr class="table-even"><td>text-decoration:none;</td></tr><t
      r class="table-odd"><td>font-weight:bold;</td></tr><tr class
      ="table-even"><td>}</td></tr><tr class="table-odd"><td>span.
      editlink span a:hover {</td></tr><tr class="table-even"><td>
      background-color:#CFCFDF</td></tr><tr class="table-odd"><td>
      }</td></tr><tr class="table-even"><td>// --></td></tr><tr cl
      ass="table-odd"><td></style></td></tr><tr class="table-even"
      ><td><span class="editlink"></td></tr><tr class="table-odd">
      <td><span></td></tr><tr class="table-even"><td><p><a href="/
      pages/editpage.action?pageId=17597007">Edit</a></td><td><a h
      ref="/display/test/subpage" title="subpage">View</a></p></td
      ></tr><tr class="table-odd"><td></span></td></tr><tr class="
      table-even"><td></span></td></tr><tr class="table-odd"><td><
      ul class="alternate" type="square"></td></tr><tr class="tabl
      e-even"><td><li>this</li></td></tr><tr class="table-odd"><td
      ><li>is</li></td></tr><tr class="table-even"><td><li>a</li><
      /td></tr><tr class="table-odd"><td><li>test</li></td></tr><t
      r class="table-even"><td></ul></td></tr><tr class="table-odd
      "><td>&#160;</td></tr><tr class="table-even"><td></td></tr><
      /td></tr></table> 
      

      Generated html B:

      <h1><a name="edit-include-B"></a>B</h1>
      <table class='confluenceTable'><tbody>
      <tr>
      <td class='confluenceTd'> 				<style type="text/css">
      		<!--
      		span.editlink {
      			float:right;position:relative;
      			font-size:0.8em;
      		}
      		span.editlink span {
      			position:relative;
      			top:0px;
      			right:0px;
      			border:1px solid #DDE;
      			background-color:#EEE}
      		span.editlink span a {
      			text-decoration:none;
      			font-weight:bold;
      		}
      		span.editlink span a:hover {
      			background-color:#CFCFDF
      		}
      		// -->
      		</style>
      		<span class="editlink">
      			<span>
      				<p><a href="/pages/editpage.action?pageId=17597007">Edit</a>|<a href="/display/test/subpage" title="subpage">View</a></p>
      			</span>
      		</span>
      		<ul class="alternate" type="square">
      	<li>this</li>
      	<li>is</li>
      	<li>a</li>
      	<li>test</li>
      </ul>
       
      </td>
      </tr>
      </tbody></table>
      

            [CONFSERVER-8756] HTML markup created from {table}{table-row}{table-cell} inserts extra <TD/>'s which interfere with macro-generated HTML contained in tables, unless SnipSnap compatibility macro is disabled.

            fixed with CONF-7648

            Cheryl Jerozal [Atlassian] added a comment - fixed with CONF-7648

            JamesM added a comment -

            noting in the title the relevance to the snipsnap compatibility macros

            JamesM added a comment - noting in the title the relevance to the snipsnap compatibility macros

            JamesM added a comment -

            yes, disabling the snip snap compatibility plugin fixes this problem. thanks don.

            JamesM added a comment - yes, disabling the snip snap compatibility plugin fixes this problem. thanks don.

            Don Willis added a comment -

            Hi James,

            luckily for both of us, somebody bumped CONF-7648 today which points the finger for your problem firmly at the Compatibility Macros. Tell me if that is your problem and I'll link this issue to that one.

            Cheers,
            Don

            Don Willis added a comment - Hi James, luckily for both of us, somebody bumped CONF-7648 today which points the finger for your problem firmly at the Compatibility Macros. Tell me if that is your problem and I'll link this issue to that one. Cheers, Don

            JamesM added a comment -

            Thanks, Don, for the re-org of this page.

            That was my first thought aswell, but I'm not sure anymore! I do have that plugin installed, but specifically disabling the 'table' macro in that plugin doesn't affect my wiki pages that use 'table', so it must be overridden by some other plugin or the core application. I'm not sure how to determine which plugin declares a table macro, short of disabling every plugin one by one, or installing each one by one on a new installation.

            JamesM added a comment - Thanks, Don, for the re-org of this page. That was my first thought aswell, but I'm not sure anymore! I do have that plugin installed, but specifically disabling the 'table' macro in that plugin doesn't affect my wiki pages that use 'table', so it must be overridden by some other plugin or the core application. I'm not sure how to determine which plugin declares a table macro, short of disabling every plugin one by one, or installing each one by one on a new installation.

            Don Willis added a comment -

            Hi James,

            What table macro are you talking about exactly?

            Do you mean the one in Adaptavist's Content Formatting Macros Plugin?

            Cheers,
            Don

            Don Willis added a comment - Hi James, What table macro are you talking about exactly? Do you mean the one in Adaptavist's Content Formatting Macros Plugin ? Cheers, Don

              cbroadfoot Chris Broadfoot [Atlassian]
              f1dc925b931b JamesM
              Affected customers:
              0 This affects my team
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: