Opened 6 years ago

Closed 6 years ago

#10537 closed Bug (fixed)

shiftEnterMode set to CKEDITOR.ENTER_P doesn't report P tag to ACF

Reported by: dilip Owned by: Piotrek Koszuliński
Priority: Normal Milestone: CKEditor 4.1.3
Component: General Version: 4.1
Keywords: Cc:

Description (last modified by Jakub Ś)

EDITED

  1. Configure editor in the following way:
    var editor = CKEDITOR.replace( 'editor1', {	
    				    toolbar:[
    						{ name: 'document', items : [ 'Source' ] }, { name: 'basicstyles', items: [ 'Bold', 'Italic' ] }, { name: 'styles', items: [ 'Format' ] }
    
    					],
    					enterMode : CKEDITOR.ENTER_BR,
    					shiftEnterMode : CKEDITOR.ENTER_P
    
  1. Go to page with editor, switch to Source and PASTE this<p>issue</p>
  2. Switch to WYSIWYG and to Source one more time
  3. Result is this<br />issue. The same thing happens for this code:
    <p>issue</p>
    this
    <p>issue</p>
    <p>issue</p>
    

It seems to me that ShiftEnterMode doesn't report P tag to ACF. To confirm this I have added { name: 'styles', items: [ 'Format' ] } to toolbar and this time it has worked without problems.

NOTES:

  1. Problem can be reproduced from CKEditor 4.1
  2. It doesn't occur if you turn off ACF - allowedContent : true or add plugin which reports P tag to ACF
  3. There is different issue (I'm not 100% sure if this is a bug) when you write in editor. Please see #10543.

Attachments (2)

config.js (421 bytes) - added by dilip 6 years ago.
build-config.js (2.6 KB) - added by dilip 6 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 6 years ago by Jakub Ś

Keywords: remove <p> when click on source removed
Status: newpending

Could you describe more precisely what do you mean because I don't understand your request.

Editor doesn't remove P tags when BR mode is used. Please explain in plain step by step scenario what is happening.

comment:2 in reply to:  1 Changed 6 years ago by dilip

Replying to j.swiderski:

Step 1) set web config like this

config.enterMode = CKEDITOR.ENTER_BR; config.shiftEnterMode = CKEDITOR.ENTER_P;

Step 2) in source write "this<p>issue</p>"

Step 3) click again in source (design mode) Step 4) now click again in source (source mode)

check source it remove the p tag and you will find text "this</br>issue"

comment:3 Changed 6 years ago by Jakub Ś

I have tried CKEditor 4.1.2 in every browser and didn't get this issue.

  1. Please describe in which Operating System and Browser you get this.
  2. Are you using one of three packages: standard, full, basic or you have created your editor with builder and there are some third-party plugins included?
  3. Could you send us your build-config.js?

Changed 6 years ago by dilip

Attachment: config.js added

comment:4 in reply to:  3 Changed 6 years ago by dilip

Replying to j.swiderski:

It is straight forward issue in all browser. I am using full version of 4.1.2.

please find the attached config for your reference.

comment:5 Changed 6 years ago by Jakub Ś

Well in my case issue isn't straight forward.

I have cleared cache in every browser then I have tried your simple TC but no luck. Code test<p>test</p> wasn't changed.

  1. I was talking about build-config.js file and not config.js so if possible please attach this one.
  2. Could you perhaps download full package and try once more? This time please just download editor, drop it on server and try running it on browser (you can clear cache as well). Please try running editor only without your application or custom scripts that might influence this problem.

Changed 6 years ago by dilip

Attachment: build-config.js added

comment:6 in reply to:  5 Changed 6 years ago by dilip

Replying to j.swiderski: Please find the attached build.config.js

issue is not coming if you only set config.enterMode = CKEDITOR.ENTER_BR;

issue comes when you have both mode on config.enterMode = CKEDITOR.ENTER_BR; config.shiftEnterMode = CKEDITOR.ENTER_P;

comment:7 Changed 6 years ago by Jakub Ś

issue comes when you have both mode on config.enterMode = CKEDITOR.ENTER_BR; config.shiftEnterMode = CKEDITOR.ENTER_P;

I did that.

Could you perhaps check what i have written in last comment:

Could you perhaps download full package and try once more? This time please just download editor, drop it on server and try running it on browser (you can clear cache as well). Please try running editor only without your application or custom scripts that might influence this problem.

comment:8 in reply to:  7 Changed 6 years ago by dilip

Replying to j.swiderski:

I got the exact case.

If you are use default toolbar then its working fine but if you customize anything then it will not work. just use below code it start giving issues.

<script type="text/javascript"> CKEDITOR.replace( 'txttest', {

toolbar:

[

{ name: 'document', items : [ 'Source' ] }, { name: 'basicstyles', items: [ 'Bold', 'Italic' ] }

]

}); </script>

can you please check and give me any workaround.

Thanks for your help.

comment:9 Changed 6 years ago by Jakub Ś

Description: modified (diff)
Status: pendingconfirmed
Summary: In 4.1.2 config.enterMode = CKEDITOR.ENTER_BR; config.shiftEnterMode = CKEDITOR.ENTER_P; <p> tag removeshiftEnterMode set to CKEDITOR.ENTER_P doesn't report P tag to ACF
Version: 4.1.24.1

comment:10 Changed 6 years ago by Jakub Ś

@dilip I have managed to reproduce this problem. If possible, please provide all necessary details when reporting bugs.

I have modified your Description. You will find two workarounds there.

comment:11 Changed 6 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.1.3

Yes, you're right that shiftEnterMode does not register its required content.

comment:12 Changed 6 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:13 Changed 6 years ago by Piotrek Koszuliński

Status: assignedreview

Pushed t/10537 on dev and tests.

comment:14 Changed 6 years ago by Frederico Caldeira Knabben

Status: reviewreview_passed

comment:15 Changed 6 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Fixed with git:c72892f on dev and 07597aef on tests.

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