Paste content creates div tags, and not p tags.


jcisio’s picture

Category: bug » support
Priority: Critical » Normal

WYSIWYG profile? Are you using CKEditor or WYSIWYG module?

Phil_oo’s picture

Maybe you have already solved this issue, but this solution could help somebody else :

If you are using WYSIWYG module, you have copied CKEditor files in the /sites/all/libraries/ folder.

You just have to update the config.js file:

CKEDITOR.editorConfig = function( config )
	config.enterMode = CKEDITOR.ENTER_P;

More info here :

kabarca’s picture

Issue summary: View changes

Probably you already solved the problem but in case it happens to someone else, there's an settings page for CKEditor which allows you to configure this kind of automated and sometimes annoying behaviors. Get to the page below and then click on "CLEANUP AND OUTPUT".

omvaishnav’s picture

Hi all,

Thanks for your reply!

Sorry that I couldn't check my messages again in these months as I had very busy schedule.

Now I want to tell you that this problem comes when I copy text from notepad file. When copy text from anywhere ckeditor auto add

tag except

. So can anyone help me to figure out this issue?

I am not using CKeditor module. I am using CKeditor library with Wysiwyg module, IMCE module and IMCE Wysiwyg bridge module.

@kabarca: I didn't not find this path in my drupal 7 site can you please help me ?

Thanks again to all for reply.

Om Vaishnav

cgeorge29’s picture

I also am having this issue, and have noticed it on several sites i maintain using this module. Anytime anything is pasted, using Paste from Word, or just plain pasted into the body, I get div tags not p tags.

  • I have made the suggested change to the js file to force p tags.
  • I also have my settings cleanup to use p tags.
  • I have also removed div from allowed tags to try and stop this.

Nothing has worked thus far. Every time anything type is pasted into the body of my CKEditor, (Full HTML or limited HTML) the result is the same, everything is wrapped in div tags (even what should be br lines) and not one p tag anywhere!

My current workaround is after pasting all text into the body, go back, highlight everything, then select "normal" from my format dropdown.

There must be a way to stop the div tags and force p tags when pasting content. All my content editors write in different programs, strip formatting, and paste into the site. :/

Any help would be greatly appreciated! Thank you!

cgeorge29’s picture

Category: Support request » Bug report
cgeorge29’s picture

Version: 7.x-1.x-dev » 7.x-1.17
Issue summary: View changes