Bug #83795

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

Added by Sascha Bucher Bucher almost 2 years ago. Updated 7 months ago.

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

0%

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.

Table.png View (37.2 KB) Sascha Bucher Bucher, 2018-02-07 09:18


Related issues

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

Associated revisions

Revision c23b1e19 (diff)
Added by Łukasz Uznański about 1 year ago

[BUGFIX] Remove surrounding &nsbp; in the tables with ol or ul in CKEditor

This patch removes generated   in tables with ol or ul inside. This
is unintented behaviour, and we can't manually remove them from table.

Also, I moved HTMLparser section into existing nonTypoTagStdWrap

Resolves: #83795
Releases: master, 8.7
Change-Id: I711e4cbab8249fe6f43c8abe6f63183eaac9131f
Reviewed-on: https://review.typo3.org/57777
Reviewed-by: Joerg Kummer <>
Tested-by: Joerg Kummer <>
Tested-by: TYPO3com <>
Reviewed-by: Jasmina Ließmann Tested-by: Jasmina Ließmann <code@frauliessmann.de> Tested-by: Thomas Alboth, undkonsorten <ta@undkonsorten.com> Reviewed-by: Jürgen Heym <juergen.heym@hof-university.de> Tested-by: Jürgen Heym <juergen.heym@hof-university.de> Reviewed-by: Rudy Gnodde <rgn@windinternet.nl> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Benni Mack <benni@typo3.org>

Revision 9d16ddb5 (diff)
Added by Benni Mack about 1 year ago

[BUGFIX] Remove surrounding &nsbp; in the tables with ol or ul in CKEditor

This patch removes generated   in tables with ol or ul inside. This
is unintented behaviour, and we can't manually remove them from table.

Also, I moved HTMLparser section into existing nonTypoTagStdWrap

Resolves: #83795
Releases: master, 8.7
Change-Id: I711e4cbab8249fe6f43c8abe6f63183eaac9131f
Reviewed-on: https://review.typo3.org/58719
Reviewed-by: Nicolai Schirawski <>
Tested-by: Nicolai Schirawski <>
Reviewed-by: Richard Haeser <>
Tested-by: TYPO3com <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Sascha Bucher Bucher almost 2 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>

#3 Updated by Oliver Hader almost 2 years ago

  • Description updated (diff)

#4 Updated by Oliver joppnet almost 2 years ago

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

#5 Updated by Oliver joppnet almost 2 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.

#6 Updated by Peter Linzenkirchner over 1 year 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.

#7 Updated by Riccardo De Contardi over 1 year ago

  • Sprint Focus set to On Location Sprint

#8 Updated by Susanne Moog over 1 year ago

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

#9 Updated by Frank Naegler over 1 year ago

  • Description updated (diff)

#10 Updated by Łukasz Uznański over 1 year ago

  • Assignee set to Łukasz Uznański

#11 Updated by Gerrit Code Review over 1 year 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

#13 Updated by Gerrit Code Review over 1 year 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

#14 Updated by Nicolai Schirawski about 1 year ago

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

#15 Updated by Gerrit Code Review about 1 year 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

#16 Updated by Gerrit Code Review about 1 year 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

#17 Updated by Łukasz Uznański about 1 year ago

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

#18 Updated by Christian Hernmarck about 1 year ago

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

#19 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Accepted

#20 Updated by Benni Mack 12 months ago

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

#21 Updated by Christian Hernmarck 12 months 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.

#22 Updated by Markus Klein 9 months ago

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

#23 Updated by Franz Kugelmann 7 months 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

Also available in: Atom PDF