Changes between Initial Version and Version 2 of Ticket #16811


Ignore:
Timestamp:
Jan 23, 2017, 10:13:05 AM (3 years ago)
Author:
Marek Lewandowski
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16811

    • Property Status changed from new to confirmed
  • Ticket #16811 – Description

    initial v2  
    1212
    1313Alignments are stripped.
     14
     15== More details ==
     16
     17It looks in Word pretty much like this:
     18
     19[[Image(https://i.imgur.com/OdLhLi5.png)]]
     20
     21The problem is that Word generates following markup:
     22
     23{{{
     24<div align=right>
     25
     26<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 style='(...)'>
     27 <tr style='(...)'>
     28        (...)
     29 </tr>
     30</table>
     31
     32</div>
     33}}}
     34
     35Which displays it correctly, but uses deprecated `align` attribute.
     36
     37We have a [https://github.com/ckeditor/ckeditor-dev/blob/7a3a51194875502fd00d9e4d23d5e87557d80d34/core/filter.js#L2098-L2107 style transformation] in core which transforms any `align` into `float` CSS prop, which is fine for elements like `table`, `img`, `iframe`, but it's wrong for `div` and `p`. Becasue for `div` and `p` it defines the alignment of content elements within this element.
     38
     39It's also worth to remember that `align` is a little more aggresive than `text-align` CSS prop, as it affects anything, whereas for `text-align` you need to apply `margin: x auto` for block-alike elements, otherwise they won't be aligned.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy