Html Paragraphs are converted to SpanAdv on loading Html

I am loading Html into a RichTextBoxAdv control.

The Html text consiste of about 100 paragraphs.

After loading (wether by RichTextBlockAdv.LoadAsync with type = Html or by implementing the HtmlText property as suggested by yourselves and assigning the html to it what I get in the rich text box document is 1 section, 1 paragraph and a number of SpanExt equivalent to the original number of paragraphs in the loaded html.

This makes it impossible to visualize the text correctly, or to apply styles to the individual paragraphs.

Am I doing something wrong? Have I not understood how RichTextBlockAdv works?

Please advise


4 Replies

PS Premkumar Sundaramoorthy Syncfusion Team August 26, 2021 12:18 PM UTC

Hi Paul,

Thanks for contacting Syncfusion support.

The SfRichTextBoxAdv control is a word document-based editor that provides HTML file import and export functionality as a secondary feature. It doesn’t use native browser control for importing (displaying) and exporting HTML text. Instead, it has won HTML file reader and writer written from scratch to perform HTML import and export from the SfRichTextBoxAdv controls document object model (DOM).

Please share your input HTML file to reproduce the reported issue from our side.

Regards,
Premkumar



PG Paul G Mariotti August 27, 2021 08:06 AM UTC

I attach one of the HTML files that I am trying to load into the SfRicvhTextBoxAdv control.

The file consists of one section containing about 370 paragraphs. It gets converted by the Html import to a Document made up of one Section containing one Paragraph made up of the same number of SpanAdv blocks as the original number of paragraphs.

I have tried using LoadAsync, I have tried extending the SfRichTextBoxAdv control by the addition of HtmlText as recommended by yourselves, I have even tried extracting all the Html paragraphs from the document and adding them one at a time to the HtmlText.

The result is always the same, one section, one paragraph and lots of SpanAdv.

Styles can only be applied to documents, paragraphs and characters, and the fact of having only one paragraph for the loaded Html means that the resulting loaded document is a contonuous stream of text without any separation between the paragraps, making the assignment of styles and the editing into a proper Word document (and its reading) very lengthy, complex and difficult.

This is not what was expected.



Attachment: testHtml_388dd8c5.7z



KG Kalaivannan Ganesan Syncfusion Team August 30, 2021 10:12 AM UTC

Hi Paul,

Thanks for the update.

We can reproduce the reported issue with “Paragraphs are converted to SpanAdv on loading Html”, and suspect this to be a defect. We will validate and update you with further details on 1st September 2021

Note:
SfRichTextBoxAdv does not supports XHTML format documents. We have reproduced the reported issue by converting shared XHTML to html document.

Please let us know If you have any other questions.

Regards,
Kalaivanan G
 



KG Kalaivannan Ganesan Syncfusion Team September 1, 2021 12:23 PM UTC

Hi Paul,

Thanks for your patience.

As we said before,  
SfRichTextBoxAdv does not support XHTML format documents, and the reported issue is reproduced by converting shared XHTML to HTML documents.

Here the problem is presence of below highlighted <xml> tag, before the <html> tag in input file. You can check the same in Microsoft word too, by opening the input HTML file. MS word showing an error dialog before opening this file and wrongly preserve the content.

 
 
 
So, we suggest you remove the highlighted tag and let the <HTML> tag as the first tag of the document to preserve the document elements properly.  
 

Please let us know if you have any other questions.


Regards,
Kalaivannan Ganesan
 
 


Loader.
Up arrow icon