Open LiamKarlMitchell opened 4 years ago
Hi @LiamKarlMitchell. Thank you for your report. To help us process this issue please make sure that you provided the following information:
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:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @magento I am working on this
@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.
Admin access: https://i-28698-2-4-develop.instances.magento-community.engineering/admin_eb47
Login: 2c8b8d46
Password: be56a0e9582a
Instance will be terminated in up to 3 hours.
@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 <em class="fa"> </em>
this should work just fine.
HI Guys not sure if this helps i past in code for a sales template which i always used in M1 no issue. But in M2 50 lines are stripped out which screws up my listing template Actual Script Pasted into Policy.txt M2E Stripped Out from Policy.txt
Is there a fix to stop this occurring
This an issue for me on 2.3.5p2 It is a common problem might be useful https://github.com/claviska/tinymce-iconfonts
Or perhaps
tinyMCE.init({ // ... extended_valid_elements : '[]', });
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 /vendor/magento/module-cms/Model/Wysiwyg/DefaultConfigProvider.php then uploaded the two files and deployed static content (finding location took some time, but hint on the tinymce page which shows the location it is expecting 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. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
:white_check_mark: Confirmed by @engcom-Bravo
Thank you for verifying the issue. Based on the provided information internal tickets MC-40681
were created
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
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...
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 /vendor/magento/module-cms/Model/Wysiwyg/DefaultConfigProvider.php then uploaded the two files and deployed static content (finding location took some time, but hint on the tinymce page which shows the location it is expecting file)
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
<plugin name="Alpine_AlpineCustom" type="Alpine\AlpineCustom\Plugin\Model\Cms\ExtendDefaultConfigProvider" />
</type>
the plugin ExtendDefaultConfigProvider.php
namespace Alpine\AlpineCustom\Plugin\Model\Cms;
use Magento\Cms\Model\Wysiwyg\DefaultConfigProvider;
class ExtendDefaultConfigProvider
{
/**
* @param \Magento\Cms\Model\Wysiwyg\DefaultConfigProvider $subject
* @param \Magento\Framework\DataObject $result
* @return \Magento\Framework\DataObject $result
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function afterGetConfig(\Magento\Cms\Model\Wysiwyg\DefaultConfigProvider $subject, \Magento\Framework\DataObject $result)
{
$plugins = "". $result['tinymce4']['plugins'] ;
$tinymceconfig = $result['tinymce4'];
$tinymceconfig['plugins'] = $plugins .' iconfonts';
$result['tinymce4'] = $tinymceconfig;
return $result;
}
}
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 https://github.com/magento/community-features/issues/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
Hi @LiamKarlMitchell,
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.
https://github.com/magento/magento2/assets/51680745/b6e73b97-647b-4a43-833c-8abead9bfc04
Tags getting removed.
Hence Confirming the issue.
Thanks.
Yep its been an issue for years, no traction
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12301 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
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. https://github.com/magefan/module-wysiwyg-advanced/issues/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.