Opened 9 years ago

Closed 9 years ago

#5694 closed New Feature (wontfix)

When config.enterMode = CKEDITOR.ENTER_BR & config.forceEnterMode = false, pressing enter inside a <p> (or <div>) should insert a new <p>

Reported by: Jonathon Sim Owned by:
Priority: Normal Milestone:
Component: UI : Enter Key Version:
Keywords: Cc:

Description

This is by analogy with the behaviour when enterMode = ENTER_P, when your text is formatted with <p> then pressing enter inserts a new <p>. Within text formatted with <div>, enter inserts a new <div>. In essence "enter" honours the format of the text you are editing

With config.enterMode = ENTER_BR however, enter always inserts a "<br>".

With the attached patch "enter" inserts a new paragraph block if you are currently in a paragraph, a div within <div>s, and <br> otherwise. forceEnterMode=true overrides this and always uses br.

In practical terms, this is desirable because it provides users a way to enter text with paragraphs, which is otherwise impossible (for instance by chosing Format: Normal from the format dropdown), and also matches the behaviour fckeditor used. And most users with enterMode = ENTER_BR do so not because we are fundamentally opposed to semantically correct markup, we just have users that don't expect the "blank line" worth of space at the top of the text that it entails.

Attachments (1)

5694.patch (460 bytes) - added by Jonathon Sim 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by Jonathon Sim

Attachment: 5694.patch added

comment:1 Changed 9 years ago by Alfonso Martínez de Lizarrondo

Resolution: wontfix
Status: newclosed

In enterMode = CKEDITOR.ENTER_BR people relly expect to create a <br> whenever they hit return. If your worries are the spacing between paragraphs, they you just have to add p {margin:0} to your stylesheet (scoped to the edited contents if needed).

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy