Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pasting empty list and converting it to different list type throws error #2438

Closed
jswiderski opened this Issue Sep 25, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@jswiderski
Copy link
Member

jswiderski commented Sep 25, 2018

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Paste the below code in Source mode of full preset sample.
<p><br></p><ul></ul><ul><li><a href="https://powerusers.microsoft.com/plugins/common/feature/oauth2sso/sso_login_redirect?referer=https%3A%2F%2Fpowerusers.microsoft.com%2Ft5%2FPowerApps-Community%2Fct-p%2FPowerApps1">Register</a></li><li><br></li><li>·</li><li><br></li><li><a href="https://powerusers.microsoft.com/plugins/common/feature/oauth2sso/sso_login_redirect?referer=https%3A%2F%2Fpowerusers.microsoft.com%2Ft5%2FPowerApps-Community%2Fct-p%2FPowerApps1">Sign In</a></li><li><br></li><li>·</li><li><br></li><li><a href="https://powerusers.microsoft.com/t5/help/faqpage">Help</a></li></ul><p><br></p>

NOTE: Starting from CKEditor 4.8 it is enough to paste just the empty list <ul></ul> to get the error.

  1. Switch to wysiwyg and click inside the editor to focus is
  2. Press Ctrl+A to select all content
  3. Click on numbered or bulleted list button

Expected result

Hard to say because Empty lists is not something standard:

  1. Empty li element gets created in empty list and it gets converted to different list type in necessary.
  2. Empty list gets removed
  3. Nothing or ul gets converted to empty ol if numbered list was pressed

Actual result

JavaScript error gets thrown:
Message: Cannot read property 'listNode' of null
URI: /ckeditor-dev/plugins/list/plugin.js
Line: 334

Other details

  • Browser: Any
  • OS: Any
  • CKEditor version: 4.0+
  • Installed CKEditor plugins: List
@mlewand

This comment has been minimized.

Copy link
Member

mlewand commented Sep 25, 2018

Looks clearly like a duplicate of #2411 to me.

@msamsel

This comment has been minimized.

Copy link
Contributor

msamsel commented Sep 26, 2018

I have some prototype of solution for the #2411 and it's fix throwing error in this case too. We could merge those 2 issues together and move any further discussion to that issue.

Approach which I used is just preventing of throwing error. This empty ul will remain in markup as user want to paste it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.