Opened 11 years ago

Closed 11 years ago

#10854 closed Bug (fixed)

[FF] Image2 in Firefox: Problems with autoparagraphing

Reported by: Olek Nowodziński Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.3
Component: General Version: 4.3 Beta
Keywords: Cc:

Description

  1. Open samples/plugins/image2/image2.html
  2. Use the following code:
    <figure class="caption" style="float:right"><img alt="Saturn V" src="assets/image1.jpg" width="200" />
    <figcaption>Roll out of Saturn V on launch pad</figcaption>
    </figure>
    
  3. Switch to WYSIWYG and back to source:
    <p>&nbsp;
    <figure class="caption" style="float:right"><img alt="Saturn V" src="assets/image1.jpg" width="200" />
    <figcaption>Roll out of Saturn V on launch pad</figcaption>
    </figure>
    </p>
    
  4. Switch to WYSIWYG and back to source:
    <p>&nbsp;</p>
    
    <figure class="caption" style="float:right"><img alt="Saturn V" src="assets/image1.jpg" width="200" />
    <figcaption>Roll out of Saturn V on launch pad</figcaption>
    </figure>
    
    <p>&nbsp;</p>
    
  5. 3. and 4. should never happen.

Change History (7)

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

Status: newconfirmed

This is caused by FF's bug which I reported in https://bugzilla.mozilla.org/show_bug.cgi?id=911201

Firefox appends bogus <br> before non-editable element what then affects parser which wraps this in a paragraph. We cannot fix (without hacking) what FF does, but we should fix the second part - broken parser. We can also add a small hack which will remove bogus <br> from the beginning of document.

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

Related issue: #4638.

comment:3 Changed 11 years ago by Marek Lewandowski

Summary: Image2 in Firefox: Problems with autoparagraphing[FF] Image2 in Firefox: Problems with autoparagraphing

Title updated.

Last edited 11 years ago by Marek Lewandowski (previous) (diff)

comment:4 Changed 11 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:5 Changed 11 years ago by Piotrek Koszuliński

Status: assignedreview

Pushed t/10854 on dev and tests.

We decided to strip leading <br> in htmlDataProcessor#toDataFormat.

comment:6 Changed 11 years ago by Frederico Caldeira Knabben

Status: reviewreview_passed

Please just have the regex simplified to this:

/^<br *\/?>/i

comment:7 Changed 11 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Fixed on major with git:2d9c3ff on dev and with 2e1b8cb on tests.

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