Closed GlennRicaud closed 5 years ago
After meeting with Alan:
Migration:
Html Editor:
Edit: The style has actually changed: Justify: No style Left: style="float: left; width: 40%;" Centered: style="margin: auto; width: 60%;" Right: style="float: right; width: 40%;"
The correct mapping is the following
6.X: <figure style="float:left; margin:15px; width:40%">
7.0: <figure class="editor-align-left" style="float: left; width: 40%;">
6.X: <figure style="float:right; margin:15px; width:40%">
7.0: <figure class="editor-align-right" style="float: right; width: 40%;">
6.X: <figure style="float:none; margin:auto; width:60%">
7.0: <figure class="editor-align-center" style="margin: auto; width: 60%;">
6.X: <figure class="justify">
7.0: <figure class="editor-align-justify">
Remaining to do on monday:
If there was a keepSize, the width was not set on the style of the figure. Adapt to check startWith ""float:left; margin:15px" rather than equals "float:left; margin:15px; width:40%"
Changes
From details in https://github.com/enonic/xp/issues/6929 and experiments, I gather that there are 5 modifications.
Change 1: Alignment 6.15: The alignment is stored on the figure element using with a hardcoded style. But from experiments, it was also stored on the image 7.0 There is now in addition an editor class (Why editor class?) stored only on the figure. And the image element does not have this style anymore. Why was this change made? The style value is still present, all the other elements do not have this class.
Change 2: HTML Area styles The HTML Editor does not save the scaling directly on the image anymore, but use a style parameter instead.
Change 3: Custom width A width that will be used on the style parameter of figure. (Can be ignored for this issue as it is an addition)
Change 4: Removal of keepSize In 7.0 you cannot do cropping based on the raw size of the image like in 6.15 (Is that intented?)
Change 5: Original style The original style will make the image be saved as an attachment link rather than an image link
Change 6: No built-in style There is no built-in styles.
Other changes There seems to be other changes like classes "captioned",...
Impacts
These changes should not have any impact on the processing of old data in LIVE/PREVIEW/INLINE mode. The processing of HTML is backward compatible (except 1 bug fix) (Details below in "Comparison of ProcessHTML between 6.15 and 7.0")
The only impact will be on the HTML Editor in Content Studio. When editing old data with the HTML editor, it will not have the correct alignment selected or any style selected Not sure if the display of the editor is backward compatible when displaying EDIT mode.
Solutions:
Solution 1: Make the editor backward compatible
Solution 2: Update the data
Editor + ProcessHTML examples
Examples to understand behaviour of the Editor and ProcessHTML in 6.15 (Image has a size of 645x430):
Examples to understand behaviour of the Editor and ProcessHTML in 7.0 (Image has a size of 645x430):
Comparison of ProcessHTML between 6.15 and 7.0.
5 possible cases and their equivalent if processed by 7.0
Process Html Link algo (In 6.15):
Process Html Link algo (In 7.0):
Conclusion: Today processHtml is fully backward compatible with 6.15 data. With this exception of the case of "no parameter" that should use "width(768)" (defined as a bug).