RichTextEditor inserts br tags in div with v-html

We are using the richTextEditor to edit partial templates.  The templates can accept vue directives such as v-for and v-if and v-html.

When we insert a <div v-html="someHTML"></div> it is converted to <div v-html="someHTML"><br></div> and this causes vue to throw an error.  Removing the <br> resolves the issue, but it is a bit of a pain to have to clean up this.  Is there a way to prevent the editor from inserting <br> tags into empty divs?


Attachment: video1004999676_ec1c55a1.zip

3 Replies

VJ Vinitha Jeyakumar Syncfusion Team April 4, 2024 11:37 AM UTC

Hi Damien Taylor,


We would like to inform you that the "<br>" tag added inside the "<div>" tag is intended to maintain the cursor position within the RichTextEditor. If you remove this "<br>" tag from the element, you won't be able to insert text or place the cursor inside the <div> element.

Regards,
Vinitha


DT Damien Taylor April 10, 2024 09:20 PM UTC

In this particular use case, there should not ever be anything in the div.  It will be dynamically generated by Vue.  It's ok though, this is an edge case.  We can close this issue, I just have to train users to manually add space in the div before saving.



GD Gokulraj Devarajan Syncfusion Team April 11, 2024 11:13 AM UTC

Kindly get back to us if you have any further queries.


Loader.
Up arrow icon