Hello,
Previously I posted a display error where the <tbody> tags are being interpreted as <tbody><br /> tags. Please see the screen shot to see what this does to the output in Drupal.

The original code that is saved in the node is -

<p>This example shows the extra <br /> tags that are being added to table output.
<table cellspacing="0" cellpadding="0" summary="" border="1">
    <tbody>
        <tr>
            <td>
            <p>This is the first line in the table</p>
            </td>
        </tr>
        <tr>
            <td>This is the second line in the table</td>
        </tr>
    </tbody>
</table>
In the original HTML code there is no extra line breaks around this table, but when displayed in Drupal the extra line breaks appear. </p>

The HTML generated by Drupal is -

<p>This example shows the extra <br /> tags that are being added to table output.</p>
<table cellspacing="0" cellpadding="0" summary="" border="1">
    <tbody><br />
        <tr>
            <td>
            <p>This is the first line in the table</p>
            </td>
        </tr>
        <tr>
            <td>This is the second line in the table</td>
        </tr>
    </tbody><br />
</table>
<p>In the original HTML code there is no extra line breaks around this table, but when displayed in Drupal the extra line breaks appear. </p>

Note the tbody tag has been appended with BR tag.

While this is a minor issue, it does cause incorrect display of content on my site, and I would hope it was a minor error in the display scripting. To display these tables I am using the Full HTML filter.

I have had a try to find this interpreter in the source code, but I have not been able to determine why this is happening. As 4.7.0 has gone to release candidate, I think this display issue is worth addressing as it appears to be a bug.

Please verify this behaviour by creating some content with a table in it and view the resulting page. If this error cannot be reproduced, then I will need to find out what is different in my Drupal system.
Thanks.

CommentFileSizeAuthor
#3 filter.module_23.patch1.77 KBtenrapid
tbody error.JPG16.82 KBKieg Khan

Comments

markus_petrux’s picture

Title: <tboby> error » <tbody> error

Removing the "line break converter" filter from the "Full HTML" input format?

Kieg Khan’s picture

Hello,
Something so easy, but I missed it. That did the trick.
Thanks.

tenrapid’s picture

StatusFileSize
new1.77 KB

Here is a patch that adds thead, tfoot and tbody to the recognized tags in the line break converter.

With this you don't have to disable the 'line break converter'.

tenrapid’s picture

Status: Active » Needs review

status ...

steph’s picture

Status: Needs review » Needs work

Hum, strange. The code seems fine, but it doesn't seem to work :-(. I'll try more.

tenrapid’s picture

Did you clear the cache table?

steph’s picture

Status: Needs work » Reviewed & tested by the community

Thanks.

Code works fine :-)

Kieg Khan’s picture

Hello,

I had made these changes to my Drupal install prior to this patch coming out and prior to posting re-posting, but it did not seem to work. I will try again and clear the cache. To help speed this up, what is the quickest, easiest way to clear the cache?

Thanks.

Steven’s picture

Status: Reviewed & tested by the community » Fixed

Has already been fixed by a more generic commit.

Anonymous’s picture

Status: Fixed » Closed (fixed)