I know there must be a config setting to fix this but for the love of god I can't figure it out...
When I paste, or paste from word, it is tossing in div's instead of p's.
For example:
<div>some text here</div> <div>some more text here</div>
.. instead of:
<p>some text here</p> <p>some more text here</p>
Anyone have this problem before?
Cheers
Re: Pasting div's instead of p's
Please check the enterMode config:
http://docs.cksource.com/ckeditor_api/s ... .enterMode
Re: Pasting div's instead of p's
Re: Pasting div's instead of p's
So you must check first what's the original code in outlook.
Re: Pasting div's instead of p's
Each paragraph shows <div> instead of <p>
I'm using Word 2007
config.enterMode = CKEDITOR.ENTER_P doesn't change anything
Re: Pasting div's instead of p's
This is bad for SEO and it makes the text appear incorrectly on my site.
I tried the "config.enterMode = CKEDITOR.ENTER_P;" fix but it didn't affect this problem.
Thanks for your help.
Re: Pasting div's instead of p's
I tried the workaround mentioned but it did not seem to correct it.
Re: Pasting div's instead of p's
Re: Pasting div's instead of p's [SOLVED]
editor.on("instanceReady", function(ev){
ev.editor.on("paste", function (ev) {
var _html=ev.data.html;
//On paste, replace DIV => P
var re = new RegExp("(<DIV)([^>]*>.*?)(<\/DIV>)","gi") ;
_html = _html.replace( re, "<p$2</p>" ) ;
ev.data.html = _html;
}
}