Local properties are not exported to HTML when style is applied over document element (paragraphs, spans, tables) in case the HtmlExportSettings.StyleExportMode is set to Inline.
To reproduce:
- Add two hyperlinks with differents font and font weights.
- Export them with the following code:
private void button1_Click(object sender, EventArgs e)
{
HtmlFormatProvider html_provider = default(HtmlFormatProvider);
string htmlBody = null;
html_provider = new HtmlFormatProvider();
html_provider.ExportSettings.StylesExportMode = StylesExportMode.Inline;
html_provider.ExportSettings.StyleRepositoryExportMode = StyleRepositoryExportMode.ExportStylesAsCssClasses;
htmlBody = html_provider.Export(radRichTextEditor1.Document);
File.WriteAllText("test.html", htmlBody);
}
- Open the file and you will notice that the custom styles are not exported (the links are having the same style).
Workaround:
html_provider.ExportSettings.StylesExportMode = StylesExportMode.Classes;