So here's the deal. After many Drupal sites, I have finally made one that is using a WYSIWYG editor (CKeditor 4.x).

I love it, except the WYSIWYG editor seems to blatantly ignore several settings.

1. It ignores the default behavior of the "Convert line breaks into HTML" text format filter

2. It ignores the customConfig settings set through a custom_hook_wysiwyg_editor_settings_alter function (things like $settings['ignoreEmptyParagraph'] = TRUE;)

Until installing WYSIWYG, I have used the above "Convert line breaks into HTML" filter on every textarea. If someone types a word, hits return 6 times, then types another word, the only HTML that is saved is the first word, wrapping a single <p> tag, and the last word, also wrapped in a <p> tag. This was perfect - made sense, kept things tidy. In fact, that exactly what happens here in the Issue editor.

Doing the same thing on the same text format in WYSIWYG mode however results in 4 empty paragraphs, each with a &nbsp; in them. "Convert line breaks into HTML" has no effect whatsoever in WYSIWYG mode, and it's driving me nuts. The same results occur with or without that native Drupal text filter enabled.

I know some people love being able to save empty paragraphs, but most of our users get return-key happy and their posts look awful.

Is there some magic that makes WYSIWYG behave like the native "Convert line breaks into HTML" filter?

Desired result:

(typed in WYSIWYG editor):

First paragraph.
// Return
// Return
// Return
// Return
// Return
Second paragraph.
// Return
// Return

(rendered HTML:)

<p>First paragraph.</p>
<p>Second paragraph.</p>

Comments

amaisano’s picture

Status: Active » Closed (works as designed)

Read through many of TwoD's posts about inherent conflicts of interest between Drupal filters and the WYSIWYG system, and understand this works more or less as designed (https://drupal.org/node/730542#comment-2667956).

I've installed the 'Empty Paragraph Killer' filter, which removes excessive empty paragraphs (with or without   characters) upon save, which suffices to keep users from generating long expanses of nothing in their posts.

apaderno’s picture

Status: Closed (works as designed) » Fixed
Issue tags: -&nbsp;, -empty paragraphs

I am removing issue tags used from one to four issues. I apologize for bumping the issue. I am setting this issue as fixed, since it's a support request that got an answer.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.