Opened 12 years ago
Closed 12 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:
- Open any sample for CKEditor 4.0, clear the screen.
- Type the paragraphs of text.
- 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>
- 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>
- 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"> </p> <p dir="ltr">This is line 2.</p> <p dir="ltr"> </p>
Issue: Notice that <br /> tag been removed & original html is modified by the insertion of p blocks with '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 12 years ago by
Milestone: | → CKEditor 4.0.2 |
---|---|
Status: | new → confirmed |
comment:2 Changed 12 years ago by
Version: | 4.0.1 (GitHub - master) → 4.0 Beta |
---|
comment:3 Changed 12 years ago by
comment:4 Changed 12 years ago by
Milestone: | CKEditor 4.0.2 |
---|---|
Resolution: | → invalid |
Status: | confirmed → closed |
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.
First bad commit git:f7f53df. It was ported from v3's commit [7526].