span tag is not getting closed in RTE when added as a plugin
Hello Team,
I have added icon plugin in 6.3 RTE which adds the icon in the RTE:
execute: function (execDef) {
var data = execDef.value,
title = data.icon || '',
imgHtml = '<span class="icon ' + title + '"/>';
execDef.editContext.doc.execCommand('insertHTML', false, imgHtml);
}
When added, the icon span tag is not getting closed as other span tag in RTE, PFB:
<div class="rte-editor u-coral-padding is-edited webkit chrome" contenteditable="true" style="outline-style: none;">
<p>
<span class="grey">Add icon here</span>
</p>
<p>
<span class="icon icon-facebook">
::before
</span>
</p>
</div>
I want to remove ::before and icon span should be:
<p>
<span class="icon icon-facebook"></span>
</p>
Please suggest.
Thanks,