4

Wygwam automatically adds some extra space in <p> tags by default. Is there any way to remove them without editing the source in Wygwam? I'm using Wygwam 2.6.3.

What is intended

<p>This is a paragraph</p>

What actually happens

<p>
     This is a paragraph</p>

2 Answers 2

5

The themes/third_party/wygwam/lib/ckeditor/config.js file actually comes with the code necessary to do this – you just need to uncomment it. Have you tried that?

1
  • duh, it was staring me right in the face!
    – Dan
    Commented Jan 11, 2013 at 15:52
3

You'll need to override the default CKEditor rules for processing P tags.

Add this:

this.dataProcessor.writer.setRules( 'p',
                {
                    indent : false,
                    breakBeforeOpen : true,
                    breakAfterOpen : false,
                    breakBeforeClose : false,
                    breakAfterClose : true
                });

to your: themes/third_party/wygwam/lib/ckeditor/config.js file.

More info here: http://ckeditor.com/forums/Support/BUG-CKeditor-adds-new-line-and-tab-space-after-P-tag

5
  • hmm, I added that and it makes sense why, but it didn't seem to work.
    – Dan
    Commented Jan 10, 2013 at 18:25
  • Did you add it inside the instanceReady function?
    – Brad Bell
    Commented Jan 10, 2013 at 18:34
  • Yep, this is what that config file looks like jsfiddle.net/CSHZD
    – Dan
    Commented Jan 10, 2013 at 18:38
  • Try clearing your browser's cache?
    – Brad Bell
    Commented Jan 10, 2013 at 18:58
  • nope :( still no luck
    – Dan
    Commented Jan 10, 2013 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.