Ticket #7512 (closed Bug: invalid)

Opened 4 years ago

Last modified 4 years ago

ckeditor accidently/wrongly creates class tags for all child items in a div

Reported by: spriebe Owned by:
Priority: Normal Milestone:
Component: General Version: 3.5.2
Keywords: Cc:

Description

I've the following code:

<div class="main-holder main-holder-2">

HEADER
TEXT

</div>

When i now select the HEADER and press H3 style the code gets:

<div class="main-holder main-holder-2">

</div>
<h3 class="main-holder main-holder-2">HEADER</h3>
<div class="main-holder main-holder-2">
TEXT
</div>

But that's def. wrong / bad it should be:

<div class="main-holder main-holder-2">
<h3>HEADER</h3>
TEXT
</div>

Greets Stefan

Change History

comment:1 Changed 4 years ago by j.swiderski

  • Status changed from new to closed
  • Keywords CSS, DIV, SUBCLASS removed
  • Resolution set to invalid

I assume the code you had in source mode was:

<div class="main-holder main-holder-2">
	&nbsp;</div>
<div class="main-holder main-holder-2">
	HEADER</div>
<div class="main-holder main-holder-2">
	TEXT</div>

You have selected 'HEADER' and whole 'div' has changed to 'h3' element. This is not a bug, this is how CKEditor works by default. It changes one block element to another.

comment:2 Changed 4 years ago by spriebe

please reopen this bug. I've again successfully reproduced it while editing a whole page. My examples are abolutely correct.

The result is exactly this (copy & paste):

div class="main-holder main-holder-2">
					#START#</div>
				<h3 class="main-holder main-holder-2">
					HEADER</h3>
				<div class="main-holder main-holder-2">
					TEXT<br />
					<br />
					BLA BLUB TEST<br />
					<br />
					#ENDE#</div>

and the start was:

div class="main-holder main-holder-2">
					#START#<br />
					HEADER<br />
					TEXT<br />
					BLA BLUB TEST<br />
					#ENDE#</div>

I think this should be reopend or is this really the expected behaviour?

comment:3 Changed 4 years ago by j.swiderski

Your example can be reproduced when enter-mode is set to BR. In this mode, part of code HEADER<br /> is treated like "separate block of code" and that is why it is surrounded with H3 and code above and below is wrapped in DIVs.
If enter-mode is set to P or DIV than whole block is chcanged to H3.

But once again this is how CKEditor works. If you want to achieve the result you are looking for than code HEADER<br /> should be wrapped around in P tags like this:

<div class="main-holder main-holder-2">
					#START#<br />
					<P>HEADER<br /></P>
					TEXT<br />
					BLA BLUB TEST<br />
					#ENDE#</div>

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