Details
-
Bug
-
Resolution: Won't Do
-
Minor
-
None
-
3.5.4
-
None
-
None
Description
FCK Editor in its standard configuration removes surrounding P tags when applying a block-element tag via the style menu. In Magnolia, it incorrectly leaves the P tag in place while putting a block-level tag within the P tag.
To reproduce:
1. Create a new Samples: Editor paragraph
2. Enter a few words of text
3. Press return
4. Press the "source" button
5. Note that the first line is now correctly wrapped in <p> and </p> tags.
6. Press "source" again to return to visual edit mode
7. Select the first line of text.
8. Choose "Page Title" from the Style menu
9. Click the "source" button again
Expected behavior:
The <p> tags should have been replaced with <h1> tags. This is how FCK Editor 2.4.3 does things if you download it and run it outside of the context of Magnolia. Since it works correctly in FCKEditor normally, it appears the issue is caused in some way by integration with Magnolia.
<h1>text</h1>
Actual behavior:
The <h1> tags are wrapped in the original <p> tags – an invalid HTML construct – like so:
<p> <h1>text</h1> </p>
At this point, if you go back and forth between source and visual mode again, or save the paragraph, FCK Editor notices the invalid structure and tries to fix it for you, resulting in a couple of extra empty paragraphs. (It was these extra paragraphs that started our customers complaining about this issue.)
<p> </p> <h1>text</h1> <p> </p>