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

Export Normal style without span

1 Answer 8 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Emin asked on 17 Jul 2018, 11:35 AM


I`m using RTB control to export to html. I want to export Headings with font-size, but Normal style without it. Currently I get in export Normal style as:

<p><span style="font-size: 16px;">test</span></p>


I want to export Normal style without span



I tried like this - but unsuccesfully:



I use code to export. but can`t ignore font-size (because it is needed for other Headings)

HtmlExportSettings set = new HtmlExportSettings
                    DocumentExportLevel = DocumentExportLevel.Fragment,
                    ExportBoldAsStrong = true,
                    ExportEmptyDocumentAsEmptyString = true,
                    ExportFontStylesAsTags = true,
                    ExportHeadingsAsTags = true,
                    ExportItalicAsEm = true,
                    ExportStyleMetadata = false,
                    SpanExportMode = SpanExportMode.DefaultBehavior,
                    StyleRepositoryExportMode = StyleRepositoryExportMode.DontExportStyles,
                    StylesExportMode = StylesExportMode.Inline

                set.PropertiesToIgnore["span"].AddRange(new[] { "font-family", "dir" });


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 20 Jul 2018, 08:14 AM
Hello Emin,

When exporting to HTML, the model of RadDocument must be mapped to the available HTML elements. Each text content is exported in a span element and I am afraid that this behavior cannot be modified as it resides in the internal logic for mapping the different models. I am sorry I couldn't help more.

Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question