Copying the following HTML into CKEditor and making a list causes the LI items to copy the styles of the parent div.
Is there a way to fix this? Or prevent inheriting styles from the parent?
HTML in question:
<table border="0" cellpadding="0" cellspacing="0" style="width:800px">
<tbody>
<tr>
<td>
<p><img alt="logo" src="logo" style="height:50px; width:500px" /></p>
<div style="margin: 20px;margin-left: 30px; border: 1px solid black;">highlight<br />
these words<br />
and make a list<br />
each <li> uses the parent <div>'s style attribute making it look weird</div>
<hr /><br />
This is an email from the fictional organisation
<p> </p>
</td>
</tr>
</tbody>
</table>
In the demo I get the after
In the demo I get the Before version. Maybe ACF is stripping some of the code. Would be nice to have the before and after code.
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
All the files I provided show
All the files I provided show how I used CKEditor. I managed to do the same thing in the demo http://ckeditor.com/demo#full
<table border="0" cellpadding="0" cellspacing="0" style="width:800px">
<tbody>
<tr>
<td>
<p><img alt="logo" src="logo" style="height:50px; width:500px" /></p>
<div style="margin: 20px;margin-left: 30px; border: 1px solid black;">highlight<br />
these words<br />
and make a list<br />
each <li> uses the parent <div>'s style attribute making it look weird</div>
<hr /><br />
This is an email from the fictional organisation
<p> </p>
</td>
</tr>
</tbody>
</table>
Hope that is clearer.
Attachments:
I've got exactly the same
I've got exactly the same issue.
I changed the template plugins source file and added my own ones. The html is valid and parses correctly but when you try and edit the areas in the template the parent attributes are copied.
get converted to this when you add anything in that div:
Just to add the config. I've
Just to add the config. I've forced the P and BR in case it was the div handler.
I'm looking at filter.js and think the culprit may be nested calls to updateAttributes and updateElement.
Can anyone help?
Ok, I asked one of the devs
Ok, I asked one of the devs and this is apparently correct behaviour, or at least a behaviour he would expect. When you have a selection in this kind of HTML:
<p>foo<br>bar^bar<br>bom</p>
You see 3 lines of text and your caret is in the 2nd one. When you press the list button I would expect to turn only the line in which I have selection into a list. The case with <div> is more complex, but it can be simplified to this scenario.
Another scenario:
<p>foo<br>bar^bar<br>bom</p>
When you change format to Heading 1. This time entire paragraph is turned into ha <h1>. Why? Well... this can be considered inconsequent, but there are no good answers unfortunately. It would be better if we were consequent (for us), but people would still complain.
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
Hi sebstefanov,
Hi sebstefanov,
Thanks for having a look :) I don't see how your comment relates to children inheriting the parent classes though? :/