Opened 12 years ago
Closed 12 years ago
#9843 closed Bug (invalid)
"formatted" option from the Format dropdown adds extra line break
Reported by: | vijendra | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Styles | Version: | 4.0 |
Keywords: | Cc: | vijendra.1007@… |
Description
When I use CKEditor 4 with attached config.js and ontents.css files, then by hitting formatted option from the Format dropdown creates extra line break.
How to reproduce:
- Go to CKEditor 4 demo page.
- Set following configuration in config.js file
/* Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.editorConfig = function (config) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; config.extraPlugins = 'syntaxhighlight,button-pre'; //config.toolbar_Full.push(['Code']); config.resize_enabled = false; }; /* http://stackoverflow.com/questions/6969081/why-does-ckeditor-add-line-breaks-and-paragraph-before-initial-text http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Output_Formatting http://stackoverflow.com/questions/1977791/turn-off-enclosing-p-tags-in-ckeditor-3-0 */ CKEDITOR.on('instanceReady', function (ev) { // Output paragraphs as <p>Text</p>. ev.editor.dataProcessor.writer.setRules('p', { indent: false, breakBeforeOpen: false, breakAfterOpen: false, breakBeforeClose: false, breakAfterClose: false }); // Output paragraphs as <p>Text</p>. ev.editor.dataProcessor.writer.setRules('pre', { indent: false, breakBeforeOpen: false, breakAfterOpen: false, breakBeforeClose: false, breakAfterClose: false }); // Output paragraphs as <p>Text</p>. ev.editor.dataProcessor.writer.setRules('br', { indent: false, breakBeforeOpen: false, breakAfterOpen: false, breakBeforeClose: false, breakAfterClose: false }); // Output paragraphs as <p>Text</p>. ev.editor.dataProcessor.writer.setRules('div', { indent: false, breakBeforeOpen: false, breakAfterOpen: false, breakBeforeClose: false, breakAfterClose: false }); });
- et following CSS in the contents.css file
p, pre { margin:0; padding:0; }
- Add following text in the CKEditor
"Test
Test
Test
Test
"
- Select the 2,3 line and hit formatted option from the Format dropdown, you will notice that extra line breaks has been added.
Attachments (2)
Change History (3)
Changed 12 years ago by
Changed 12 years ago by
Attachment: | contents.css added |
---|
comment:1 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
I have tried your editor from previous example. I don’t have this problem. There are no spaces between text and text in pre tag.
Please remember that if you want to apply neew CSS and reset some of the existing rules sometimes CRTL+F5 in not enough and cache refresh is needed.