HtmlDataProvider have Export and Import methods. When it exports a RadDocument, the output string value looks like:
<
style
type
=
"text/css"
>
p { margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;text-indent: 0px;text-align: justify; }
body { font-family: 'Segoe UI, Lucida Sans Unicode, Verdana';font-size: 14.6666669845581px;color: #000000; }
.Normal { telerik-style-type: paragraph;telerik-style-name: Normal;border-collapse: collapse; }
.TableNormal { telerik-style-type: table;telerik-style-name: TableNormal;border-collapse: collapse; }
.p_6120A7F8 { telerik-style-type: local;font-family: 'Verdana';font-size: 16px;color: #000000; }
.li_8271C7C8 { telerik-style-type: local;margin-left: 24px;text-indent: 0px;font-family: 'Segoe UI, Lucida Sans Unicode, Verdana';font-size: 14.6666669845581px;color: #000000; }
.p_22D3F7F7 { telerik-style-type: local;margin-right: 0px;font-family: 'Verdana';font-size: 16px;color: #000000; }
</
style
>
<
ol
start
=
"1"
style
=
"list-style-type:decimal"
>
<
li
value
=
"1"
class
=
"li_8271C7C8"
>
<
p
class
=
"Normal p_6120A7F8"
>Lorem</
p
>
</
li
>
<
li
value
=
"2"
class
=
"li_8271C7C8"
>
<
p
class
=
"Normal p_22D3F7F7"
>Ipsum</
p
>
</
li
>
<
li
value
=
"3"
class
=
"li_8271C7C8"
>
<
p
class
=
"Normal p_22D3F7F7"
>Dolor</
p
>
</
li
>
<
li
value
=
"4"
class
=
"li_8271C7C8"
>
<
p
class
=
"Normal p_22D3F7F7"
>Sit</
p
>
</
li
>
<
li
value
=
"5"
class
=
"li_8271C7C8"
>
<
p
class
=
"Normal p_22D3F7F7"
>Amet</
p
>
</
li
>
<
li
value
=
"6"
class
=
"li_8271C7C8"
>
<
p
class
=
"Normal p_22D3F7F7"
>etc.</
p
>
</
li
>
</
ol
>
With this settings:
var provider =
new
HtmlFormatProvider
{
ExportSettings =
new
HtmlExportSettings
{
DocumentExportLevel = DocumentExportLevel.Fragment,
StylesExportMode = StylesExportMode.Classes,
ExportEmptyDocumentAsEmptyString =
true
,
ExportLocalOrStyleValueSource =
true
,
StyleRepositoryExportMode = StyleRepositoryExportMode.ExportStylesAsCssClasses,
ExportFontStylesAsTags =
true
,
},
ImportSettings =
new
HtmlImportSettings
{
UseDefaultStylesheetForFontProperties =
true
,
UseHtmlHeadingStyles =
true
}
};
But when I trying to Import it back, value of RadDocument doesn't contains List definitions and replace it with just simple paragraphs instead of <li> items.
How to prevent it? Crazy logic!
P.S.: Why not to make out CSS shorten by replace
the "margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;"
with JUST one item: "margin:0"? Even "margin: 10px 10px 10px 10px" will be more compact.
And "font-family: 'Segoe UI, Lucida Sans Unicode, Verdana';font-size: 14.6666669845581px;color: #000000;"
with "font:'Segoe UI, Lucida Sans Unicode, Verdana' 14px #000" ?
And container "li" has unnecessory "p" inside it. Dirty HTML.
Telerik for SL version: 2018.1.116.1050