Opened 9 years ago

Last modified 8 years ago

#13625 confirmed Bug

Numbered List adds items when switching from Source to Preview Mode

Reported by: Alex Gorale Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0
Keywords: Cc:

Description

CKEditor 4 with the current Editor Options configured:

                language: 'en',
                uiColor: '#741275',
                allowedContent: true,
                removePlugins: 'image',
                extraPlugins: 'image2,uploadimage,colorbutton,table,tableresize,tabletools,dialogadvtab',
                filebrowserImageUploadUrl: '/scripts/uploadImage.php',
                colorButton_enableMore: true

Replicate: Open Page => Add/Remove Numbered List => Add some items to the list

My test source:

<ol>
	<li>item1</li>
	<li>item2</li>
	<li>item3</li>
</ol>

In Source mode add some line breaks between items

Test Source now looks like:

<ol>
	<li>item1</li>
	<li>item2</li><br>
	<li>item3</li><br>
</ol>

Toggle between Source/Preview mode. CKEditor will start adding line breaks and list items

After 1 iteration Test Source now looks like:

<ol>
	<li>item1</li>
	<li>item2</li>
	<br />
	<li>item3</li>
	<br />
	<br />
	&nbsp;
</ol>

Keep toggling and it becomes

<ol>
	<li>item1</li>
	<li>item2</li>
	<br />
	<li>item3</li>
	<br />
	<br />
	<br />
	<br />
	<br />
	<br />
	<br />
	&nbsp;
	<li>&nbsp;</li>
	<li>&nbsp;</li>
	<li>&nbsp;</li>
	<li>&nbsp;</li>
	<li>&nbsp;</li>
</ol>

Expected result

CKEditor should not add line breaks and new list items. Hopefully it would just remove the line break tag.

Actual result

CKEditor adds line breaks and list items

Other details (browser, OS, CKEditor version, installed plugins)

See above

Change History (5)

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

Status: newpending
Version: 4.5.2

You didn't mention on what browser you can reproduce this and in which CKEditor version. I could not be able to reproduce this on Chrome and I really don't think it's reproducible without some tricky additional steps because we would be flooded by bug reports about this. Please try to reproduce it on one of the official samples or build one (e.g. on JSFiddle) and record the necessary steps.

comment:2 Changed 9 years ago by Alex Gorale

Oh, I thought since testing the steps to reproduce was part of the process of submitting the bug the first place folks would go is the demo

http://ckeditor.com/demo

Goto the demo and paste into the source mode:

<ol>
	<li>item1</li>
	<li>item2</li><br>
	<li>item3</li><br>
</ol>

then toggle the source button a few times. I'm running chrome Version 44.0.2403.125 (64-bit) and have also tested Firefox 39.

CKEditor info: timestamp:"F62A",version:"4.5.1 (Standard)",revision:"a513a92" Here's a video: https://www.youtube.com/watch?v=VTtJT8EQiag&feature=youtu.be

Last edited 9 years ago by Alex Gorale (previous) (diff)

comment:3 Changed 9 years ago by Jakub Ś

Status: pendingconfirmed
Version: 4.0

According to http://www.w3.org/TR/html-markup/ul.html#ul or https://html.spec.whatwg.org/multipage/semantics.html#the-ul-element, permitted content inside ul are only li tags script-supporting elements so such content should not be used in the first place.

CKEditor should however IMO remove these BRs and NOT duplicate them.

Problem can be reproduced from CKEditor 4.0 (works fine in beta) in every browser.

Last edited 8 years ago by Jakub Ś (previous) (diff)

comment:4 Changed 8 years ago by uschwarz

FWIW, changing the brs to

<br /><!-- -->

seems to be safe for brs both inside and outside the lis, but it's still a very annoying problem (and still present up to and including nightly builds).

comment:5 Changed 8 years ago by Jakub Ś

Please check workaround mentioned in #10146

There is one issue where it doesn't work but from what I have checked it works perfect for lists with br's.

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