New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor should not remove "empty" (but styled) elements #8878
Comments
This issue has been marked as stale because:
Please comment with an update if you believe this issue is still valid or if it can be closed. This issue will also be reviewed for validity and priority (cc @designsimply). |
This is still an issue with version 11.9. |
@salty-horse thanks for the issue and comment! We are moving toward a new block editor, so I tested this with 11.9 using Me > App Settings > Use Block Editor enabled and found that the empty Video: 1m34s (tested with WPiOS 11.9 on iPhone 6S iOS 12.1.4) Because the functionality works as requested in the block editor, I recommend closing this issue and would also like to get a second opinion about that. |
I can see how that's annoying, but I don't think we can support in Aztec without major changes. The block editor should do a better job of respecting HTML, although it's still based on Aztec for rich text editing, so if you edit the block with that tag it might get corrupted. I agree with @designsimply, closing this one. Please reopen if you see it happening in the block editor and we'll evaluate options again. |
This bug is split off from #7932. Could be related to #7920.
Expected behavior
All HTML elements should be kept intact.
Actual behavior
Empty
<a>
elements are removed, maybe other element types.Such elements are also silently removed when trying to edit existing posts with the rich text editor, which is bad.
Steps to reproduce the behavior
Enter this
<a>
element in HTML editing mode (from iTunes' official Link Maker)<a href="https://itunes.apple.com/us/app/wordpress/id335703880?mt=8" style="display:inline-block;overflow:hidden;background:url(https://linkmaker.itunes.apple.com/assets/shared/badges/en-us/appstore-lrg.svg) no-repeat;width:135px;height:40px;background-size:contain;"></a>
Switch back to the rich text editing mode. The element is gone.
Tested on WPiOS 9.4 (latest)
In general, empty elements should not be removed. Every element can important behavior attached to it, even if it's empty. For example, their contents can be controlled by CSS styles or javascript, and empty tags can still serve as linkable anchors for fragment URLs, used by e.g. a table of contents on the same page.
The text was updated successfully, but these errors were encountered: