Here is my html
<div class="span4 padding-right padding-left">
<legend> Information</legend>
<div class="row-fluid">
<div class="span4 strong text-right">Name</div>
<div class="span8 ">myname</div>
</div>
<div class="row-fluid">
<div class="span4 strong text-right">Contact </div>
<div class="span8 ">my conctact</div>
</div>
<div class="row-fluid">
<div class="span4 strong text-right">Phone</div>
<div class="span8 ">123456789</div>
</div>
<div class="row-fluid">
<div class="span4 strong text-right">Email</div>
<div class="span8 ">myemail@email.com</div>
</div>
</div>
CKEditor removes/re-aligns the outer div when in edit mode.
Which gets converted to :
<div class="span4 padding-right padding-left"></div>
<legend> Information</legend>
<div class="row-fluid">
<div class="span4 strong text-right">Name</div>
<div class="span8 ">myname</div>
</div>
<div class="row-fluid">
<div class="span4 strong text-right">Contact </div>
<div class="span8 ">my conctact</div>
</div>
<div class="row-fluid">
<div class="span4 strong text-right">Phone</div>
<div class="span8 ">123456789</div>
</div>
<div class="row-fluid">
<div class="span4 strong text-right">Email</div>
<div class="span8 ">myemail@email.com</div>
</div>
My HTML seems to be valid. Why is this occuring?
The HTML is invalid in the
The HTML is invalid in the first example. A legend can't be used anywhere else than in fieldset. http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#the-legend-element
Granted, CKEditor breaks the code in an attempt to fix it and it shouldn't, but with so many HTML tags there are countless possibilities and it is impossible for the editor to fix/foresee them all.
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!
Cue bunch of singing Vikings in a cafe....
<div class="span8 ">myemail@email.com</div>
Unless you have a pressing need for p*nis pills and previously-unknown Nigerian millionaire relatives, I suggest you do not put unprotected email addresses on public webpages. It is trivially easy to robotically harvest such constructs with a regex or DOM.