Opened 6 years ago

Closed 6 years ago

#10678 closed Bug (worksforme)

Importing the Saved Apostrophe

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

Description

When the apostrophe is typed into the editor, the program automatically converts to ' Then I can save this to the database. But When I go to edit the page in the future, after the Content is imported back into the editor, the editor removes the ' and replaces it with the apostrophe. So when I go to save the page, I get the mysql Error, because I used an apostrophe.

Change History (1)

comment:1 Changed 6 years ago by Jakub Ś

Keywords: Apostrophe removed
Resolution: worksforme
Status: newclosed

Editor uses http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-entities_additional to encode apostrophe.
It seems that browsers themselves change entity to ' character. If, in latest CKEditor, you disable ACF you will get this default behaviour but if ACF will be turned on, editor will change apostrophe back to entity when you use getData method.

Try using below code with ACF disabled and enabled and you will see the difference.

var editor = CKEDITOR.replace( 'editor1', {					
				//allowedContent : true,
});
editor.on('instanceReady', function(evt){
	evt.editor.setData('<p>ssss &#39 ssss </p>');
	setTimeout(function(){alert(editor.getData() );}, 1000);				
});
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy