-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
In WYSIWYG editor, i tags with class but no content are removed. #28698
Comments
Hi @LiamKarlMitchell. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
|
@magento give me 2.4-develop instance |
Hi @LiamKarlMitchell. Thank you for your request. I'm working on Magento 2.4-develop instance for you |
Hi @LiamKarlMitchell, here is your Magento instance. |
@magento Confirmed on 2.4-develop Entered in the content in source editor. <p>CMS homepage content goes here.</p>
<p>Icon should be here: <i class="footer-icon icon-line-clock"></i></p> Click the Show / Hide editor, wait a moment. Click the Show / Hide editor again to go back to source editor. Content lacks the "icon" element. <p>CMS homepage content goes here.</p>
<p>Icon should be here:</p> |
Issue: Confirmed |
This is because somehow not an entirely recognized html tag by tinymce. And tinymce also remove an empty html tag because it's "empty". At this moment I am using |
HI Guys not sure if this helps i past in code for a sales template which i always used in M1 no issue. Is there a fix to stop this occurring |
This an issue for me on 2.3.5p2 Or perhaps tinyMCE.init({ |
following last post i have installed the tinymce plugin mentioned above (tinymce-iconfonts) and it allows me to use e.g. font-awesome immediately. had to edit file to add plugin as per here - https://devdocs.magento.com/guides/v2.4/ui_comp_guide/components/wysiwyg/configure-tinymce-editor.html added plugin to this file |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions! |
Yes still a problem stale bot. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions! |
Posting a comment. Issues should not be automatically closed. |
There really should be a "built in" way to extend the tinymce options as part of setting up a Magento 2 site. Currently it warns that things like aria, role etc won't be allowed (why? I would like my CMS content to be as accessibility tagged properly! And adding icons without having to nbsp them... |
Thanks to @danielpugh 's hints I dabbled a minimal implementation to integrate https://github.com/claviska/tinymce-iconfonts and at first glance it's working - though if I missed something someone please shout :) my module is Alpine/AlpineCustom js plugin files uploaded to lib/web/tiny_mce_4/plugins/iconfonts a di.xml for adminhtml
the plugin ExtendDefaultConfigProvider.php
seems to allow i to stay empty, but alas it "eats" the style tag so modern fontawesome options arent possible - I mean it's an old plugin! Definitely going to look at extending tinymce configuration to allow more tags as per magento/community-features#326 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 28 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions! |
@stalebot this is still a problem |
Thanks for your reporting and collaboration. We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the attached video. Screen.Recording.2024-06-27.at.10.03.38.movTags getting removed. Hence Confirming the issue. Thanks. |
Yep its been an issue for years, no traction |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-12301 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Bravo. Thank you for verifying the issue. |
Summary (*)
These are used for icons to be shown in some blocks/content and so editing the content causes the icons to be removed.
It probably removes empty spans as well but I have not tried this yet.
Duplicate of #21602 which was closed for no reason.
magefan/module-wysiwyg-advanced#13
Preconditions
Magento 2.3.0
Magento 2.4-develop
Examples (*)
Steps to Reproduce
Edit a block or page content in the source edit.
Click show editor.
Click hide editor.
Actual Result
And its gone...
Expected Result
Tag is not removed
Another example
Becomes
You can hack around it with an html comment as content such as
But then it gets changed into an em.
Font awesome for example uses i tags.
In my case, WeltPixel Pearl theme uses i tags, especially their example content that is imported with the theme which we just want to edit/tweak as needed.
Proposed solution
Keep tags if they have no content when there are classes or attributes set.
Maybe this should only apply to some tags such as a, i, div, span?
Perhaps not p tags as TinyMCE if I recall litters them all over the place and the removal of empty elements was made to clean up such issues, best if can consider i and span tags as non empty when they have class.
The text was updated successfully, but these errors were encountered: