Opened 13 years ago

Last modified 13 years ago

#8868 confirmed Bug

Hitting return should create a new default block element.

Reported by: Brian Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: Cc:

Description

Sorry if the title isn't very descriptive, but here is the issue. If I add a <div> tag to the document, then hit enter/return, it creates a new <div> tag even though the default block element is a <p> tag. This is a major problem for clients when they copy/paste content that may have a stray <div> tag. If they paste something with a <div> tag, then start typing new text after that, the <div> tag hijacks the current block level element being used and there is no way to return to it without editing the source.

Personally I have an issue with this because it does not allow me to insert a custom <div> tag around, lets say, an image. I'd like to create something such as:

Expected: <p>text</p> <div class="figure"><img src=... /></div> <p>text</p>

Actual <p>text</p> <div class="figure"><img src=... /></div> <div class="figure">text</div>

Lastly, you may wonder why I'm adding a div with the class of "figure", well, because CKeditor does not recognize the <figure> element.

Expected behavior:

<p> tags should be the default block level element _always_. Regardless of what was preceding it. Hitting return/enter should use that default block element, not continue to use the previous block element. Ideally it would recognize <figure> as well. I'd like to be able to insert a <figure> element containing an image, hit return, then start typing text into a <p> tag, not a <div> or <figure> tag containing text. HTML5 support was added to a recent version, but apparently someone forgot about the <figure> tag.

Change History (1)

comment:1 Changed 13 years ago by Jakub Ś

Status: newconfirmed
Version: 3.6.23.0

Tag <figure> is HTML5 for which CKEditor v3 doesn't have full support yet.

From CKEditor 3.5.4 it is possible to exit div block by simply clicking under it. New paragraphs (inside div) get also created when enter key is pressed.

<div><p>test</p></div>

There is however one condition for the above to happen. There has to be a paragraph inside div. If you have code like the one below

<div>test</div>

enter key will always create new div despite the fact that ENTER_MODE is set to "P"

Issue reproducible from CKEditor 3.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