Magento2: 2.0.4 - WYSIWYG Editor strips empty HTML codes out

Created on 27 Apr 2016  路  9Comments  路  Source: magento/magento2

We are having an issue with the WYSIWYG editor where we need to add something like
<em class="vendor-icon vendor-cart"> </em>
Which would result in an icon

The editor strips out empty html tags and therefore we can't add Icons to our page content.

This can't be really intended in views of technologies like Fontello, Font Awesome and stuff like that.

Whats a good workaround for this? We can't really deactivate the editor, though (customer needs it)

Cms Format is not valid Ready for Work bug report

Most helpful comment

@Ctucker9233: looks like the fixes are only included in 2.2.0 and up
Relevant commits, which seem to have something to do with this: https://github.com/magento/magento2/commit/f1ebd5c2bdf07c114f24126be8c4e97c0149997c & https://github.com/magento/magento2/commit/9a998de390ee5bf0608577c666a12bf292493242

Feel free to backport these to 2.1.x if you have some spare time for this.

All 9 comments

I think this is down to Tiny MCE editor and not so much Magento 2, I'm not sure how helpful it will be but this is the workaround for Magento 1 - http://alanstorm.com/magento_html5_tinymce

A quick workaround worth trying would be to add a span with content that has display: none set. Something like:

<em class="vendor-icon vendor-cart"><span style"display: none;">1</span></em>

Hi @kingalca

Thank you for reporting this issue.
I created internal ticket MAGETWO-52378 to investigate and fix.

cc @elenleonova

@vkorotun @elenleonova Hello, could you let me know if there is any update on your internal issue MAGETWO-52378 please.
Thanks

Hello, is there any update for the internal issue ?

MAGETWO-52378 is delivered into develop branch

@magento-engcom-team This fix is not included in 2.1.10. What release might it be in?

@Ctucker9233: looks like the fixes are only included in 2.2.0 and up
Relevant commits, which seem to have something to do with this: https://github.com/magento/magento2/commit/f1ebd5c2bdf07c114f24126be8c4e97c0149997c & https://github.com/magento/magento2/commit/9a998de390ee5bf0608577c666a12bf292493242

Feel free to backport these to 2.1.x if you have some spare time for this.

@hostep Alright, I'll look at it and give it a go.

Was this page helpful?
0 / 5 - 0 ratings