Hi,
I recently started using ckeditor and having some troubles getting pasting from Libreoffice to look the way i want when pasting text and lists, whether it's bulleted or numbered lists. However i write the same thing in Microsoft Office i dont get the extra space when i paste it into ckeditor. Iv'e been searching for quite a while, but without finding the answer i need. I narrowed it down to, that when I paste from libre office alot of <p> and </p> tags are surounding the text when i look at the source. Iv'e made an little example.
When pasted from Libre office it looks like this:
<ul>
<li>
<p>This is</p>
</li>
<li>
<p>A Bulleted</p>
</li>
<li>
<p>List</p><ul>
<li>
<p>With a sub bullet</p>
</li>
</ul>
</li>
</ul>
And when pasted from Word or if i paste from libre office and into word and then to ckeditor it looks like this:
<ul>
<li>This is</li>
<li>A Bulleted</li>
<li>List
<ul style="list-style-type:circle">
<li>With a sub bullet</li>
</ul>
</li>
</ul>
Which is what i want it to look like ?
How could this be solved ?
I tried various things with entermodes and some replace functions as well, what I found in other posts about p tags and libre office. But nothing worked so far.
I really hope someone can help me.
//NicolaiS
Unfortunately every
Unfortunately every combination of browser <-> MS Word/Libre Office produce different kind of crappy HTML. We've got a special filter for most of the combinations with MS Word, but we haven't yet implemented a special filter Libre Office. So currently content comming from Libre Office is filtered by the general filter, which does a good job (as you can see the HTML is pretty clean), but e.g. it does not remove those unnecessary paragraphs.
If you want to handle this, you could try to listen on editor#paste event, recognise when content from Libre Office is pasted, and clean it up.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+