Project

General

Profile

Actions

Bug #83795

closed

&nbsp; in the tables with <ol> or <ul>

Added by Sascha Bucher Bucher almost 7 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2018-02-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
frontendrendering rte ckeditor
Complexity:
Is Regression:
Sprint Focus:

Description

If you insert a table in the RTE-field and use just a list inside a table cell (<ol> or <ul>) inside a table cell there will in the frontend output alway a &nbsp; included before and after the list. This &nbsp; does not exist in the backend if you switch to code view but in the frontend. This moves the list always one line down in the table so it is not anymore on the same hight as the table row bevor or after.

This is to output in the frontend with this strange  :

<table class="contenttable">
  <tbody>
    <tr>
      <td>
        <p>List</p>
      </td>
      <td>
         &nbsp;
        <ol> 
          <li>Item 1</li>
          <li>Item 2</li>
          <li>Item 3</li>
        </ol>
        &nbsp;
      </td>
    </tr>
  </tbody>
</table>

PS: If you insert a table in the RTE-field which provides the extension news. This problem does not happen. So I guess news uses an other rendering method for the RTE-fields.


Files

Table.png (37.2 KB) Table.png Sascha Bucher Bucher, 2018-02-07 09:18
cattura2.png (273 KB) cattura2.png Riccardo De Contardi, 2020-03-11 23:11

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #86819: Since 8.7.20 (#83795) all <p>&nbsp;</p> are converted to <p></p>Closed2018-11-01

Actions
Actions #1

Updated by Sascha Bucher Bucher almost 7 years ago

The nbsp is not visible in the ticket, sorry. Here again.

<table class="contenttable">
<tbody>
<tr>
<td>
<p>List</p>
</td>
<td>
((nbsp is inserted here))
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
((nbsp and heir))
</td>
</tr>
</tbody>
</table>

Actions #3

Updated by Oliver Hader almost 7 years ago

  • Description updated (diff)
Actions #4

Updated by Oliver joppnet almost 7 years ago

Just run into the same issue with TYPO3 8.7 and PHP 7.1. Any workaround or fix would be appreciated.

Actions #5

Updated by Oliver joppnet almost 7 years ago

After some digging in the TS object browser we figured the following lines of TS setup solved the issue for us:

lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.innerStdWrap_all.ifBlank >
lib.parseFunc_RTE.nonTypoTagStdWrap.encapsLines.innerStdWrap_all.ifBlank =

We're still testing if this breaks anything other than purposely removing the

&nbsp;
around
<ol>
or
<ul>
tags in RTE table cells.

Actions #6

Updated by Peter Linzenkirchner over 6 years ago

Same Problem here (TYPO3 8.7 latest version). The two lines from Oliver fixed the problems. No side effects until now, if i find some i will post.

Actions #7

Updated by Riccardo De Contardi over 6 years ago

  • Sprint Focus set to On Location Sprint
Actions #8

Updated by Susanne Moog over 6 years ago

  • Tags changed from table &nbsp; ul ol frontendrendering rte creditor to frontendrendering rte ckeditor
Actions #9

Updated by Frank Nägler over 6 years ago

  • Description updated (diff)
Actions #10

Updated by Łukasz Uznański over 6 years ago

  • Assignee set to Łukasz Uznański
Actions #11

Updated by Gerrit Code Review over 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57777

Actions #13

Updated by Gerrit Code Review over 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57777

Actions #14

Updated by Nicolai Schirawski about 6 years ago

In Typo3 9.5 the problem doesn't exist: there is no   in Frontend.

Actions #15

Updated by Gerrit Code Review about 6 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57777

Actions #16

Updated by Gerrit Code Review about 6 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58719

Actions #17

Updated by Łukasz Uznański about 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #18

Updated by Christian Hernmarck about 6 years ago

  • Related to Bug #86819: Since 8.7.20 (#83795) all <p>&nbsp;</p> are converted to <p></p> added
Actions #19

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Accepted
Actions #20

Updated by Benni Mack about 6 years ago

Reverted due to a regression https://forge.typo3.org/issues/83795

Actions #21

Updated by Christian Hernmarck almost 6 years ago

In the database it looks like this after saving (insert table, insert list, save):

<td>{space}{tab}{tab}{tab}<ol>{space}{tab}{tab}{tab}{tab}<li>1. eins</li>{space}{tab}{tab}{tab}{tab}<li>2. zwei</li>{space}{tab}{tab}{tab}</ol>{space}{tab}{tab}{tab}</td>

{space} and {tab} to make it clear... :-) - normal intended html structure

if you remove all the tabs and spaces directly in the database and reload the frontend - the &nbsp; are away...

If you remove the spaces between td and ol (and /ol /td) in rte (source view) and save then the spaces are not there in the database and also the &nbsp; are away. But if you reopen the content in rte again -> the tabs are there again (with all the problems when saving)

This also happens with

<td>&nbsp;<div>foobar</div>&nbsp;</td>

but not with

<td><a href="/">Start</a></td>

I guess that block elements inside a td-pair will be structured and therefore get some tabs/spaces around. Theese should not be converted to &nbsp; in the frontend.

Hope this will help other people to find a solution.

Actions #22

Updated by Markus Klein almost 6 years ago

  • Assignee deleted (Łukasz Uznański)
  • % Done changed from 100 to 0
  • Sprint Focus deleted (On Location Sprint)
Actions #23

Updated by Franz Kugelmann over 5 years ago

we use the following 2 lines. This avoids the nbsp; around <ol> and <ul> within a <td>, but still keeps the <p>nbsp;</p> intact.

lib.parseFunc_RTE.externalBlocks.table.HTMLtableCells.default >
lib.parseFunc_RTE.externalBlocks.table.HTMLtableCells.default.stdWrap.parseFunc =< lib.parseFunc
Actions #24

Updated by Georg Ringer almost 5 years ago

  • Status changed from Accepted to Needs Feedback

I have just checked current master and using the following HTML in a text element

<table class="contenttable">
    <tbody>
        <tr>
            <td>
            <p>List</p>
            </td>
            <td>
            <ol>
                <li>Item 1</li>
                <li>Item 2</li>
                <li>Item 3</li>
            </ol>
            </td>
        </tr>
    </tbody>
</table>

and the output in the frontend is

<td><ol>                 <li>Item 1</li>                 <li>Item 2</li>                 <li>Item 3</li>             </ol></td>

which looks ok to me. can someone check that as well?

Actions #25

Updated by Riccardo De Contardi almost 5 years ago

Tested with the same HTML reported by Georg Ringer on comment 24

Results:

TYPO3 10.4.0-dev: not present

TYPO3 9.5.14: still present

I checked the configuration of lib.parseFunc_RTE on the two versions and fount that TYPO3 10.4.0-dev has

lib.parseFunc_RTE.externalBlocks.table.HTMLtableCells.default.stdWrap.parseFunc.nonTypoTagStdWrap.encapsLines.innerStdWrap_all.ifBlank =

while TYPO3 9.5.14 does not. (don't know if there are other changes) See attached screenshot

Actions #26

Updated by Georg Ringer almost 5 years ago

  • Status changed from Needs Feedback to Closed

Closing issue because works in 10 and solution available as well

Actions

Also available in: Atom PDF