Magento2: CMS page/block removes tags with empty contents

Created on 12 Jan 2016  路  8Comments  路  Source: magento/magento2

I tried to used font awesome and added it to a block in admin.

in the content area input code like:

        <div>
            <a href="#"><i class="fa fa-youtube-square"></i></a>
            <a href="#"><i class="fa fa-linkedin-square"></i></a>
            <a href="#"><i class="fa fa-facebook-square"></i></a>
            <a href="#"><i class="fa fa-twitter-square"></i></a>
        </div>

When you click "Show/Hide Editor" twice, you will see the content above not showing in editor.

However, the contents can be loaded in frontend.

Clear Description Confirmed Format is not valid Ready for Work Reproduced on 2.1.x Reproduced on 2.2.x Reproduced on 2.3.x bug report triage wanted

All 8 comments

@Vincentguo1990 Why do you use empty tags? Please do not forget about accessibility! Please add some description to the links, and just hide them using css properties to avoid problems with screen readers.

Hi MomotenkoNatalia

Why do you use empty tags?
Because sometime I just need empty tags to show icons, background images or just occupy place.

Please add some description to the links, and just hide them using css properties to avoid problems with screen readers.
I do not think this is a good idea.

And it only support basic html tag, it remove/rename not recognised tags. It is not even support html5 tags.

try this in you magento2 block:

<div><i>test</i></div>
<div><divs>test</divs></div>
<article>test</article>
<aside>test</aside>
<footer>test</footer>
<dialog>test</dialog>

This is the contents I got after click "Show/Hide Editor" twice

<div><em>test</em></div>
<div>test</div>
<p>test test test test</p>

@Vincentguo1990 tnank you for reporting.

Internal ticket MAGETWO-48451 was created to investigate this issue

Soooo.... any progress on this?

@Vincentguo1990, thank you for your report.
We've created internal ticket(s) MAGETWO-48451 to track progress on the issue.

@Vincentguo1990, thank you for your report.

Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.

You may learn more about this initiative following this link.

Please feel free to comment or reopen the ticket if you think it should be reviewed once more. Thank you for collaboration.

C'mon guys I can't believe you closed this. The issue still exists over 3 years later. There is no reason why the editor should ever remove content like that.

Any updates on that? This is pretty annoying to work with

Was this page helpful?
0 / 5 - 0 ratings