This is a migrated thread and some comments may be shown as answers.

HTML bullets and numbered list issue

3 Answers 267 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Jayesh
Top achievements
Rank 1
Veteran
Jayesh asked on 09 Nov 2020, 11:46 AM

Im facing an issue with styling of  HTML bullets and numbered list. I want to achieve following output. Bullets and number size gets increase and i don't want that

My Output is :

<ol><li value=\"1\" style=\"margin-top: 0px;margin-right: 0px;margin-bottom: 0px;text-indent: 0px;line-height: 1.15;font-family: 'Verdana';font-size: 16px;color: #000000;\"><span style=\"font-family: 'Segoe UI';font-size: 13.33px;color: #000000;\">Procedure to Clean Oil tank</span></li></ol>

Expected output : 

 <ol><li value=\"2\"><span style=\"font-family: 'Segoe UI';font-size: 13.33px;color: #000000;\">Procedure to Clean Oil tank</span></li></ol>

 

Please help

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 10 Nov 2020, 10:55 AM

Hello Jayesh,

This can be achieved by adding the undesired properties to the PropertiesToIgnore collection. However, we have a known issue with the list properties. You can track its progress, subscribe to status changes, and add your comment to it here: RichTextBox: PropertiesToIgnore can't be used to control how the properties of a list will be exported.

Unfortunatelly, I cannot suggest a workaround in this case.

Thank you for your understanding.

Regards,
Dimitar
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/.

0
Jayesh
Top achievements
Rank 1
Veteran
answered on 10 Nov 2020, 02:25 PM

Thank you for the reply. But I was not able to achieve desired output. 

Following is my code:

fileName.xaml.cs file:

DocumentFormatProvidersManager.AutomaticallyLoadFormatProviders = false;
            var data = new HtmlFormatProvider();
            data.ExportSettings.DocumentExportLevel = DocumentExportLevel.Fragment;
            data.ExportSettings.ExportFontStylesAsTags = true;
            data.ExportSettings.StylesExportMode = StylesExportMode.Inline;
            data.ExportSettings.StyleRepositoryExportMode = StyleRepositoryExportMode.DontExportStyles;
            data.ExportSettings.PropertiesToIgnore["li"].Add("font-size");
            DocumentFormatProvidersManager.RegisterFormatProvider(data);
            DocumentFormatProvidersManager.RegisterFormatProvider(new TxtFormatProvider());

Output:

<li value="2" style="margin-top: 0px;margin-right: 0px;margin-bottom: 12px;line-height: 1.15;font-family: 'Verdana';font-size: 16px;color: #000000;"><span style="font-family: 'Segoe UI';font-size: 12px;color: #000000;">ddddddd</span></li>

 

Can you provide demo project?

0
Dimitar
Telerik team
answered on 11 Nov 2020, 10:52 AM

Hi Jayesh,

Perhaps I was unclear in my previous post. Your approach is correct but because of the issue, this is not working. Once the issue is resolved this will work as expected. Unfortunately, I cannot suggest a workaround for this issue. 

Let me know if you have any other questions.

Regards,
Dimitar
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/.

Tags
RichTextBox
Asked by
Jayesh
Top achievements
Rank 1
Veteran
Answers by
Dimitar
Telerik team
Jayesh
Top achievements
Rank 1
Veteran
Share this question
or