Opened 9 years ago

Closed 9 years ago

#12811 closed Bug (invalid)

Formatting and selection issue

Reported by: dumkac@… Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Paste this code "a<br />b<br />c<br />" to editor and select all these lines and set them as Bold. Go back for example to the first line where you want to continue writing in that line but now without bold and click on Bold icon again to disable this formating option. It will remove bold from the whole selection you had selected before.

Steps to reproduce:

  1. Click to source button
  2. Paste this code "a<br />b<br />c<br />"
  3. Click to source button
  4. Select all lines and set them as Bold.
  5. Go to the end of first line.
  6. Click on Bold icon.

It will remove bold from the whole selection you had selected before.

Can be reproduced on your demo page. http://ckeditor.com/demo

Change History (1)

comment:1 Changed 9 years ago by Jakub Ś

Resolution: invalid
Status: newclosed

It works that way by design.

Please look at the source this test case produces

<strong><br />b<br />c<br /></strong>

When you put cursor behind "a", the element path shows that you are inside strong tag. Since there is only collapsed selection (blinking cursor) the bold tag gets removed.

This approach is very convenient because when user wants to unbold whole word or text wrapped in one strong tag he doesn't need to select whole of it but simply click inside it and press bold button.


Perhaps this is a matter of changing approach. You can type bold text behind a word then select it and unblod it. When selection contains at least one character/space (isn't collapsed) this will work as you would expect it.


Note: You can use paragraphs (Enter Mode P) as they always give expected results. If you worry about spaces between lines (margins) added by browsers, please note that you can style paragraphs through contents.css file and apply them with margin:0; padding : 0;

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