Opened 4 years ago

Last modified 4 years ago

#13162 confirmed Bug

BBCode plugin crash with smiley

Reported by: kayue Owned by:
Priority: Normal Milestone:
Component: General Version: 4.1
Keywords: Cc:

Description

http://plnkr.co/edit/3cupW1Y2T7zWWTXxtyyF?p=preview

It returns Uncaught TypeError: Cannot read property 'children' of null

Happens when smiley is at the very front of quote.

[quote]:D hello[\quote]

Change History (7)

comment:1 Changed 4 years ago by Jakub Ś

Resolution: duplicate
Status: newclosed

For some reason your sample didn't work for me but when looking at your configuration I can see this issue is a duplicate of #8198.

comment:2 Changed 4 years ago by DLLM

Hi j.swiderski,

http://plnkr.co/edit/UPfGRXL3zIM9x3tetJQ0?p=preview

In script.js If I run:

    //It works
    CKEDITOR.instances.editor1.setData('[color=red]:D hello[/color]');
    
    //It is not working
    CKEDITOR.instances.editor1.setData('[quote=red]:D hello[/quote]');

I think what you said it is duplicated might not be the case. As color BBCode works if the first word in it is a Smiley but not for Quote I would love to fix it but I hove no clue where to start.

Any ideas?

Last edited 4 years ago by DLLM (previous) (diff)

comment:3 Changed 4 years ago by Jakub Ś

Resolution: duplicate
Status: closedreopened

comment:4 Changed 4 years ago by Jakub Ś

Status: reopenedconfirmed
Version: 4.1

@tom10271 thanks for looking in to this. You are right this is not a duplicate.

Problem can be reproduced from CKEditor 4.1 in all browsers.

Executing below code causes JS error:

CKEDITOR.instances.editor1.setData('[quote=red]:D hello[/quote]');

Error is: Message: Uncaught TypeError: Cannot read property 'children' of null
URI: /ckeditor-dev/plugins/bbcode/plugin.js
Line: 584
Code: fragment.writeHtml( writer, bbcodeFilter );

comment:5 Changed 4 years ago by DLLM

After I tried to fix this problem, I am half way to go. I will create a pull request in GitHub after I finish fixing I tried to let the team to decide the coding and data handling.

comment:6 Changed 4 years ago by Jakub Ś

@tom10271 thanks for working on it.

Please note that it is required to provide tests to your PR and describe what or which bug does it fix exactly. Please see e.g. https://github.com/ckeditor/ckeditor-dev/pull/185 or other accepted pull requests.

comment:7 Changed 4 years ago by hilmialasari

is there anoyone has fixed it ? i'm getting the same problems too

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