Opened 6 years ago

Closed 6 years ago

#9912 closed Bug (invalid)

Switching to source and back creates invalid html

Reported by: Satya Minnekanti Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0 Beta
Keywords: IBM Cc: Damian, Teresa Monahan

Description

To reproduce the defect:

  1. Open any sample for CKEditor 4.0, clear the screen.
  1. Type the paragraphs of text.
  1. Switch to source mode and you will see the following.
<p dir="ltr">This is line 1.</p>

<p dir="ltr">This is line 2.</p>
  1. While in source mode add a <br /> between the two p's as shown below.
    <p dir="ltr">This is line 1.</p>
    
    <br />
    
    <p dir="ltr">This is line 2.</p>
    
  1. Switch out of source mode and then back to source mode and you will see the following invalid html.
<p dir="ltr">This is line 1.</p>

<p dir="ltr">&nbsp;</p>

<p dir="ltr">This is line 2.</p>

<p dir="ltr">&nbsp;</p>

Issue: Notice that <br /> tag been removed & original html is modified by the insertion of p blocks with &nbsp;'s.

This is very problematic since we have many docs that exist with embedded br's and every time we save & reload them, they become more and more corrupt.

This works in 3.6.6 but after step 4 go to Rich Text mode and keep your cursor in between the 2 paragraph's

See that empty space br get's removed

Change History (4)

comment:1 Changed 6 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.0.2
Status: newconfirmed

comment:2 Changed 6 years ago by Piotrek Koszuliński

Version: 4.0.1 (GitHub - master)4.0 Beta

First bad commit git:f7f53df. It was ported from v3's commit [7526].

comment:3 Changed 6 years ago by Piotrek Koszuliński

[7526] was reverted in v3 by [7676] (#9167). It should have been reverted in v4 as well.

comment:4 Changed 6 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 4.0.2
Resolution: invalid
Status: confirmedclosed

The v3 issue was much broader. Not only the <br> was adding a <p>, but it was also keeping the <br> in place. It was really broken.

While working on #8167, I recall we undestood that the v4 behavior is the right one, but it was difficult to achieve it with v3. Therefore, we agreed to have a different behavior on v4, so [7526] must not be reverted here.

The current v4 behavior is desired. It transforms invalid orphan inline elements into block elements.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy