Panel
Newbie
Funrunna
0 votes
Discus 76 views

Double line spacing in full wysiwyg editors

Is there any way to remove the (default) double spacing on pressing enter, before the end of line is reached naturally?

The above two lines and this paragraph break look natural and it suits standard document text formatting. However, this is not good for say a 'poetry' website, which is what I am hoping to put together and I need the output to look like this:

Mary had a little lamb
it's fleece, was white as snow,
and everywhere that Mary went
that lamb, was sure to go.

NOT LIKE THIS...

Mary had a little lamb

it's fleece, was white as snow

and everywhere that Mary went

that lamb, was sure to go.

The first version in bold, can only be achieved by cutting and pasting from  MS Note Pad and this is not an intuitive way for my future site users to work. I think it can clearly be seen, that the double line spacing in the 2nd version of the 'poem' looks wholly unacceptable. This default behaviour is a major issue for poetry writers generally. So, any help to overcome this will be most appreciated.

by Funrunna asked Sep 29, 2015 in Plugins

Please log in or register to add a comment.

Please log in or register to answer this question.

1 Answer

Expert
Vanbells
+1 vote
 
Best answer

For wyswyg editors,

To get a single line, you press SHIFT + Enter Key

Ex.

I am going to write a poem
I am writing a poem
I am writing a poem

To get double line space, you press just Enter.

Ex.

I am going to school

I have come home

I live in the world

Now how to interchange the two programatically?

Go to site.com/qa-plugins/wysiwyg-editor/ckeditor/config.js

open the config.js file

The contents are as follows;

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For complete reference see:
    // http://docs.ckeditor.com/#!/api/CKEDITOR.config

    // NOTE: if you make changes to this file, make sure that you do not overwrite it when upgrading Q2A!

    // The toolbar arrangement, two rows of buttons
    config.toolbar = [
        { name: 'basic', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript' ] },
        { name: 'color', items: [ 'TextColor', 'BGColor' ] },
        { name: 'align', items: [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ] },
        { name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
        '/',
        { name: 'font', items: [ 'Font', 'FontSize', 'Format' ] },
        { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote' ] },
        { name: 'links', items: [ 'Link', 'Unlink' ] },
        { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar', 'Smiley' ] },
        { name: 'last', items: [ 'RemoveFormat', 'Maximize' ] }
    ];

    // Set the most common block elements
    config.format_tags = 'p;h1;h2;h3;pre';
    config.entities = false;
    
    //add this line to reduce double lines
    config.enterMode = CKEDITOR.ENTER_BR; // inserts `<br />`

    // Make dialogs simpler
    config.removeDialogTabs = 'image:advanced;link:advanced;table:advanced';

    // Use native spell checking (note: Ctrl+right-click is required for native context menu)
    config.disableNativeSpellChecker = false;

};

Add the bold lines above

by Vanbells answered Sep 29, 2015
by Funrunna selected Sep 30, 2015

3 Comments

Thanks Vanbells... The shift + Enter certainly helps a lot. But it would be good if this could be solved programatically. Perhaps presented as an 'alternative' editor plugin if it's not something easily added by the not so technically minded? Please let me know if you find a/the work around. I am more than just curious/interested.
I have edited  the answer to include how to do it programmatically

Please log in or register to add a comment.

Welcome to PowerQA. PowerQA is a new discussion software (not OSS). Here is a community for PowerQA developers. Current stable version is V1.9.4. It is enhanced day by day.

Statistics

  • 338 questions
  • 276 answers
  • 480 comments
  • 100 users

Post types

...