Forum
ckeditor - setting styles not working; editor adds extra apostrophes
So, it seems like the editor adds additional quotes to the class="" definition, when you define styles.
This is how my config.js:
/**
* @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/license
*/
// additional styles
CKEDITOR.stylesSet.add( 'sla_styles', [
// Block-level styles.
// Inline Styles
{ name: 'weißer Text', element: 'span', styles: { 'color': '#ffffff' } }
]);
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For the complete reference:
// https://docs.ckeditor.com/#!/api/CKEDITOR.config
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbarGroups = [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'forms' },
{ name: 'tools' },
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'others' },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'about' }
];
// Remove some buttons, provided by the standard plugins, which we don't
// need to have in the Standard(s) toolbar.
config.removeButtons = 'Underline,Subscript,Superscript';
// Se the most common block elements.
config.format_tags = 'p;h1;h2;h3;h4;h5;h6';
// Make dialogs simpler.
config.removeDialogTabs = 'image:advanced;link:advanced';
// eigene Styles
config.stylesSet = 'sla_styles';
};
I dont know if it is a bug, but maybe someone can suggest a workaround for this or tell me what I am doing wrong here?
Thanks in advance!
What do you get when you view the HTML source?
This is whats in the sourcecode:
<span style=â€color:#80bc9fâ€>
Which would be
&ldquo
's.€1: I'd like to add, that adding
html="true"
to thetext_block.html
removed this issue, now it works correctly. I still think that this is a little weird, but maybe its wrong from me to expect that.If you are using ckeditor it inserts HTML. So you need to add html="true" as explained in the documentation.
https://docs.grabaperch.com/docs/templates/attributes/type/textarea/