Opened 11 years ago
Last modified 8 years ago
#10924 confirmed Bug
Attributes and styles are stripped from block elements when they are pasted in the editor
Reported by: | Teresa Monahan | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.0 Beta |
Keywords: | IBM | Cc: | Satya Minnekanti, Irina |
Description
To Reproduce:
- Place the following in the Source view of the editor. This is just a styled div containing some text:
<div name="styledDiv" style="padding-bottom: 4px; background-color: rgb(255,255,204); margin: 8px; padding-left: 4px; padding-right: 4px; padding-top: 4px; border-radius: 6px">Sample text inside a styled Div</div>
- Switch back to wysiwyg mode and click on the editor contents.
- Select the div in the elementspath bar and use Ctrl+C to copy it.
- Insert a paragraph below the div using the magicline feature.
- Paste the div from your clipboard using Ctrl+V
Problems:
- In FF, the div has been converted to a paragraph element and all attributes and styling have been removed.
- In Chrome, the div has been converted to a paragraph element and all attributes and styling except the background color have been removed.
- This usecase works well in IE.
Scenario 2:
- Clear the editor contents and repeat steps 1-4 above.
- Enter some text into the new paragraph created in step 4 above and press enter.
- Paste the div contents from your clipboard again.
Problems:
- In IE, the div has been converted to a paragraph element and all attributes and styling have been removed.
- In Chrome, the div has been converted to a paragraph element and all attributes and styling except the background color have been removed.
- This usecase works well in FF.
Note: The name attribute in the sample code provided will always be removed when ACF is enabled. However, the same results as outlined above also occur even when ACF is disabled.
Change History (4)
comment:1 Changed 11 years ago by
Status: | new → confirmed |
---|---|
Version: | 4.2.2 (GitHub - master) → 4.0 Beta |
comment:2 Changed 9 years ago by
Summary: | Attributes and styles are stripped from div elements when they are pasted in the editor → Attributes and styles are stripped from block elements when they are pasted in the editor |
---|
Problems can be reproduced from CKEditor 4.0 beta. This doesn't happen in editor 3.x.
<div name="styledDiv" style="padding: 4px; background-color: rgb(255, 255, 204); margin: 8px; border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom-right-radius: 6px; border-bottom-left-radius: 6px;">Sample text inside a styled Div</div> }}}