Opened 9 years ago

Closed 9 years ago

#13837 closed Bug (wontfix)

Mixed paragraph content in table cells

Reported by: Packs Owned by:
Priority: Normal Milestone:
Component: Core : Tables Version: 3.0
Keywords: Cc:

Description

Steps to reproduce

  1. Create a table 1x1 and enter some text
  2. Underneath the table type two short paragraphs of text
  3. Copy the two paragraphs and paste onto end of the table cell

Expected result

<td><p>some text</p><p>One</p><p>Two</p></td>

Actual result

<td>some text<p>One</p><p>Two</p></td>

Other details (browser, OS, CKEditor version, installed plugins)

Happens in Firefox (41) and IE (10)

Is there a way to force paragraphs in table cells?

Change History (4)

comment:1 Changed 9 years ago by Marek Lewandowski

Status: newconfirmed

comment:2 Changed 9 years ago by Jakub Ś

Keywords: table cell paste removed
Version: 4.5.43.0

Issue can be reproduced from CKEditor 3.0.

When you type in newly created table there is no paragraph. This is rather understandable - not everyone may want to have his text wrapped in paragraph right away (besides there might be different enter modes used).

Assuming that enter mode is set to Paragraph. When you press enter after typing few chars, you are getting both lines wrapped in paragraphs. Perhaps the same should be done when you paste html into cell with just plain text.

comment:3 Changed 9 years ago by Packs

Yes I agree, it would be nice if there was an config option to force a paragraph for a single line of text in a cell though.

Anyway, for pasting I use a function on paste to map out <br>s to <p>s which helps. Also when processing I use <xsl:template match="text()[parent::td]"> to catch the text outside the other <p>s and map that into its own <p>.

I did notice when you copy two paragraphs in Firefox, it adds a <br> before the end of the first paragraph, e.g. <p>One</p><p>Two</p> when copied and then pasted, ev.data.dataValue is <p>One<br></p><p>Two</p> Not sure if that is a bug? It doesn't happen with IE10.

comment:4 Changed 9 years ago by Marek Lewandowski

Resolution: wontfix
Status: confirmedclosed

@Packs

The ticket is valid, and we'd love to support such config option however complete fix would be pretty complicated. This is due to multiple code path that we would need to handle, as tables have numerous ways to be modified. Then again having this option to be configurable just multiplies the code and further maintenance cost. Mentioned multiple enter modes doesn't make it any easier, and do I have to add that the same solution should be then applied also to list items? :)

In our opinion current solution fits the best to the most cases as the most common case for making table is to present conceise tabular information and we definitely don't want to add paragraphs here.

What I can suggest is that if you don't need to handle all the possible ways of editing table content you can pack your JS processing code into a plugin. You might also share it and link in this ticket for any people that will find similar requirement.

As for FF issue, please fill a separate ticket for it and we can discuss it there, thanks!

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy