Neither TinyMCE nor FCKEditor work correctly with drupal.

Try this:
- Create an article with Filtered HTML format and save
- Edit this article using TinyMCE or FCKEditor --> all linebreaks get broken
- Use force linebreak plugin --> seems to work in some cases in Firefox
- Use force linebreak plugin and Internet Explorer --> chaos --> does not work
- Use force linebreak plugin in Firefox and click undo button after editing some lines --> article gets broken
- Try to reconfigure for several hundreds of hours --> chaos --> still does not work

I tried everything, tested everything, tested "force linebeak plugin".
THERE IS NO WORKING SOLUTION. This module must be set to double beta with an warning: "Do not use WYSIWYG editors in drupal - there is no working solution!"

BUT: Clients need an WYSIWYG editor.
WHEN will WYSIWYG work together with drupal without problems even if articles have been saved with Full HTML oder Filtered HTML input format and are edited with one of the WYSIWYG editors?

Comments

TwoD’s picture

Title: No WYSIWYG editor is working correctly with drupal » Newline conversion for Filtered HTML
Category: bug » support
Priority: Critical » Normal
Status: Active » Fixed

The easiest solution is simple: Do not use the "Line break converter" input filter with WYSIWYG editors, they already put <br> and <p> tags where they need to be and you are guaranteed to have a mess if you tell Drupal to also treat newlines as breaks. With an editor on and that filter off, proper breaks won't be a problem (and you can get neatly formatted HTML - using linebreaks the way they were meant to be used). If you already have content which doesn't use the proper tags, technically it's the content which is now broken.

This behavior is not a bug in Wysiwyg module, nor the editors, but a conflict of interests. Drupal lets you write non-standard/simplified markup - to approximate the rendered node - which it transforms into valid markup during rendering. WYSIWYG editors let you write content the way you intend it to be rendered and outputs markup which is already valid to match that. Both approaches can't be used at the same time without conflict.
All WYSIYWG modules will have this problem with existing content which technically contains a single paragraph. The modules/editors are not broken, but simply incompatible with an option provided by Drupal Core, much the same way they're incompatible with "HTML Filter" removing style attributes.

The plugin/code being developed in #513998: Plugin to convert p- and br-tags to newlines might be able to take care of converting linebreaks into tags (and back again) some day, but it's a tricky subject and we're not likely to include such code until 3.x when we have a better architecture to support it. When that code works as intended (and for all editors), you could leave that filter on.

Until then, you have to convert all existing content created using the linebreak converter to use proper <p> and <br /> tags. Someone came up with this PHP code in an issue for the fckeditor.module to automate this for at least node bodies: http://drupal.org/node/240633#comment-873722. You could also use a separate format without an editor for old content, and then convert it to use the new format when it needs to be updated, if that works will of course depend on what site it is.

As we already have an issue about creating a "compatibility layer" for content without <p> and <br /> tags, I'm changing this to a support request on how to best deal with the situation until that issue is fixed, and marking it with "fixed" as I've given my answer.

sun’s picture

Status: Fixed » Closed (duplicate)

Actually, duplicate of aforementioned issue ;)