Completed
Last Updated: 25 May 2021 15:10 by ADMIN
Release 2.25.0
Richard
Created on: 17 Aug 2020 15:30
Category: Editor
Type: Bug Report
1
The Editor adds a <br> tag in empty paragraphs when typing for the first time or when updating the content from the ViewHTML dialog

Try running an editor with content like this:

 

<p>Para 1</p><p><br></p><p>Para 2</p><p><br></p><p>Para 3</p>

 

Now, open the ViewHtml button from the full toolset and Update the content without modifying anything.

The result is that there are more <br> tags in the the empty paragraphs than what we started with, and they are added every time you repeat this process.

*** Thread created by admin on customer behalf ***

1 comment
ADMIN
Marin Bratanov
Posted on: 20 Aug 2020 12:08

Some more details, this also happens when you write for the first time in the editor. Reproducible and video of the behavior are added as a reference below.

EDIT: A workaround is to replace empty paragraphs with a paragraph that has a non-breaking space when loading the content. For example, in this sample app that would look like this:

// in the component with the editor

void LoadContent() => Content = EditorStorage.Content.Replace("<p></p>", "<p>&nbsp;</p>").Replace("<p><br></p>", "<p>&nbsp;</p>");

in the service - so we have some mockup content (not needed for your test case):

public string Content { get; set; } = "<p>Para 1</p><p></p>";

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.