5

I'm working with content owners who think it's a good idea to compose their content in Microsoft Word. Although I've created a detailed guide for them on how to make this less painful (describing how to format things in meaningful ways in Word, like using header styles instead of just bolding your text to make it look like a header--things that are obvious to anyone who cares about semantic HTML, and that should be obvious to a user of Word who actually cares about quality and precision instead of just spewing words all over the page), they pretty much ignore it and create poorly formatted content, which of course means it just gets worse when copied and pasted into a rich text editor in Drupal.

Since they don't know HTML, and so can't easily fix this horrible formatting in the rich text editor, I've suggested copying it into a text editor (probably Notepad for them) and then pasting it in, and adding the formatting again in the rich text editor.

The problem I'm running into here is that the WYSIWYG module, or else CKEditor itself, creates elements for each paragraph instead of

elements. I'm not sure why this is, but it is of course a very bad thing from the points of view of semantic HTML, CSS styling, and any other point of view I can think of.

How can I fix this? How can I set things up so that plain text which is pasted into the WYSIWYG editor will give me

elements for each paragraph instead of elements?

4

I believe this problem is unique to the Chrome browser, i.e. when pasting text directly into the WYSIWYG you get divs instead of paragraphs. In Firefox, for instance, you get paragraphs instead.

One workaround is to use the "Paste as plain text" or "Paste from Word" buttons. This should give you paragraphs instead of div tags.

You could also click the "Source" button and paste the text, then when clicking "Source" again the text should be converted into HTML with paragraphs.

  • You're right that I'm using Chrome... any idea why Chrome would affect things? I tested on the Aloha Editor and it worked fine in Chrome. (Unfortunately that module isn't working in my Drupal site.) – iconoclast Nov 10 '12 at 23:28
  • It looks to be a webkit issue and affects how CKEditor handles pasting. There is a beta available for CKEditor version 4 that should take care of this issue, but it's likely it won't work with the Drupal module. – enzipher Nov 11 '12 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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