Opened 12 years ago

Closed 11 years ago

#10190 closed Bug (fixed)

Removing block style by editor.removeStyle should result in paragraph not div

Reported by: Piotrek Koszuliński Owned by: Marek Lewandowski
Priority: Normal Milestone: CKEditor 4.4.0
Component: Core : Styles Version: 4.0 Beta
Keywords: Cc: hello@…

Description

  1. Open replacebyclass sample.
  2. Focus editor and place caret in the header (h1).
  3. Paste this in the console: CKEDITOR.instances.editor1.removeStyle( new CKEDITOR.style( { element: 'h1' } ) );
  • Expected result: h1 was removed, so "Apollo 11" should be a paragraph, because enterMode=P
  • Actual: <div>Apollo 11</div>

This behaviour should be enterMode aware - in div mode it should transform element to <div>, in br mode it should remove it completely.

Change History (10)

comment:1 Changed 12 years ago by Buzogany Laszlo

Cc: hello@… added

comment:2 Changed 12 years ago by Buzogany Laszlo

I think the problem comes from the style.js where the this._.enterMode is not defined.

Doing this, resolve the problem:

this._ = {
  definition: styleDefinition,
  enterMode: CKEDITOR.config.enterMode
};

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

I replied for your pull request:

https://github.com/ckeditor/ckeditor-dev/pull/33#issuecomment-14835366

Unfortunately your patch isn't correct, but now we at least know that style was aware of enter mode.

comment:4 Changed 12 years ago by Buzogany Laszlo

Yes, you have right. There should be an other solution. For now and for me this was good, but your developpers will decide how to correclt handle this problem. Thanks for the help!

comment:5 Changed 12 years ago by Jakub Ś

Status: newconfirmed
Version: 4.0 Beta

Problem can be reproduced in all browsers from CKEditor 4 beta.

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

Milestone: CKEditor 4.4
Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:7 Changed 11 years ago by Marek Lewandowski

Owner: changed from Piotrek Koszuliński to Marek Lewandowski

comment:8 Changed 11 years ago by Marek Lewandowski

Status: assignedreview

Pushed to t/10190 at dev and t/10190 at tests.

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

Status: reviewreview_passed

I pushed rebased and corrected branches.

comment:10 Changed 11 years ago by Marek Lewandowski

Resolution: fixed
Status: review_passedclosed

Fixed with git:c1cc4d2dc1 (merged to major) at dev and 0c6fc1b635 (merged to major) at 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