Opened 15 years ago

Closed 15 years ago

#3190 closed Bug (fixed)

Auto-fix block-less paragraphs

Reported by: Frederico Caldeira Knabben Owned by: Garry Yao
Priority: Normal Milestone: CKEditor 3.0
Component: General Version:
Keywords: Confirmed 3.0RC Review+ Cc:

Description

When moving the caret inside the editor (on selectionChange), the editor could automatically fix paragraphs with no blocks, resulting in a more accurate WYSIWYG experience, as after all the paragraphs will be fixed on output.

Attachments (7)

3190.patch (1.9 KB) - added by Garry Yao 15 years ago.
3190_2.patch (2.0 KB) - added by Garry Yao 15 years ago.
3190_3.patch (1.9 KB) - added by Garry Yao 15 years ago.
3190_4.patch (2.7 KB) - added by Garry Yao 15 years ago.
3190_5.patch (4.8 KB) - added by Garry Yao 15 years ago.
3190_6.patch (7.0 KB) - added by Garry Yao 15 years ago.
3190_7.patch (9.2 KB) - added by Garry Yao 15 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 15 years ago by Frederico Caldeira Knabben

Priority: HighNormal

Changed 15 years ago by Garry Yao

Attachment: 3190.patch added

comment:2 Changed 15 years ago by Garry Yao

Keywords: Review? added
Owner: changed from Frederico Caldeira Knabben to Garry Yao
Status: newassigned

The following steps could be used to test the functionality.

Procedures

  1. Open the replace by class example page;
  2. Clear all document content by switch to 'source' mode, delete all source codes and switch back;
  3. Type some random text, then click on the 'Bold' to apply style;
    • Expected Result: Elements path is shown as : body -> p -> strong.

Changed 15 years ago by Garry Yao

Attachment: 3190_2.patch added

comment:3 Changed 15 years ago by Garry Yao

Limit to fix contents within 'body' only.

comment:4 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

We already have a function for it: range::fixBlock. You should try using it.

Changed 15 years ago by Garry Yao

Attachment: 3190_3.patch added

comment:5 Changed 15 years ago by Garry Yao

Keywords: Review? added; Review- removed

comment:6 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: 3.0RC added

comment:7 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

After talking with Garry, we've found out that the patch is doing more than needed, and can be simplified.

Changed 15 years ago by Garry Yao

Attachment: 3190_4.patch added

comment:8 Changed 15 years ago by Garry Yao

Keywords: Review? added; Review- removed

I've identified some other problem with the patch though:
Sometimes it's troublesome to have a range start within a bookmark node, e.g. extractContent/insertNode will duplicate the bookmark node which will result in weird result, the patch is proposing a fix to the this case by the 'optimizeBookmark' function.

Changed 15 years ago by Garry Yao

Attachment: 3190_5.patch added

comment:9 Changed 15 years ago by Garry Yao

Keywords: Confirmed Review? 3.0RCConfirmed 3.0RC Review?

Including the related latest patch from #3180 for easy reviewing.

Changed 15 years ago by Garry Yao

Attachment: 3190_6.patch added

Changed 15 years ago by Garry Yao

Attachment: 3190_7.patch added

comment:10 Changed 15 years ago by Garry Yao

Fixing several issues encountered during peer reviewing with Fred.

comment:11 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:12 Changed 15 years ago by Garry Yao

Resolution: fixed
Status: assignedclosed

Fixed with [3549].

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