Hi Members,
We are facing an issue where <span> element is getting added to text with its own styling while dragging text within Rich Text (RTE) component.
In the below example, when I drag "world" to the end of line, span element got added.
BEFORE:
<p>world world
<a data-popemb="Pop-up" class="content-popup" href="/content/we-retail.html" target="_self" style="font-size: 0.955555em; background-color: rgb(255,255,255);">hello</a>
</p>
AFTER:
<p>world
<a data-popemb="Pop-up" class="content-popup" href="/content/we-retail.html" target="_self" style="font-size: 0.955555em; background-color: rgb(255,255,255);">hello</a>
<span style="font-size: 12.4222px;">world </span></p>
Could you please help in finding the root cause of the issue ?
Views
Replies
Total Likes
Hi @yashaswidotiya ,
If I have understood your requirement correctly then you can use context='html' to output markup. Like below-
${properties.title @context='html'}
Reference-
Hi Ritesh,
I think you have misunderstood my question.
The issue here is not with markup but during authoring itself. While you drag the data inside rich text component from 1 place to another, span element get added surrounding the dragged content. you can have a look at the code snippet in question, where i dragged "world" to end of the string, span got added to it.
@yashaswidotiya , @Ritesh_Mittal I'm also facing the same issue while using custom styles inside RTE, style classes are getting wrapped up with the additional span tag so unable to target html elements directly with their respective classes.
Views
Likes
Replies
Views
Likes
Replies