Hello,
I have a situation where a user can create some text using Kendo UI Editor that later gets inserted into a document. All goes well except if the HTML contains a list (bullet or numbered) where one or more of the list item has some kind of character formatting (bold, italic, font color,...). In the resulting document, the formatted text is placed in a new paragraph, inside the list.
The code I use to insert the HTML text into the document is:
var paragraph = section.Blocks.AddParagraph();
editor.MoveToParagraphStart(paragraph);
HtmlFormatProvider htmlProvider =
new
HtmlFormatProvider();
RadFlowDocument htmlDocument = htmlProvider.Import(htmlText);
var insertOptions =
new
InsertDocumentOptions
{
ConflictingStylesResolutionMode = ConflictingStylesResolutionMode.UseTargetStyle
};
editor.InsertDocument(htmlDocument, insertOptions);
The HTML used is:
<
p
>Lorem ipsum dolor sit amet, <
strong
>consectetur</
strong
> adipiscing elit. Aenean viverra augue nec consectetur porta.</
p
>
<
ul
>
<
li
>Sed aliquet <
strong
>nibh</
strong
> vitae ligula vestibulum.</
li
>
<
li
>Iid ullamcorper dolor sollicitudin.</
li
>
</
ul
>
<
p
>Nunc volutpat dui dui, <
em
>eget laoreet est sollicitudin at</
em
>. Curabitur mi ipsum, feugiat nec tortor a, tristique elementum purus.</
p
>
<
ol
>
<
li
>Duis <
em
>nec</
em
> dignissim nunc.</
li
>
<
li
>Aenean dui arcu.</
li
>
<
li
>Vulputate eget leo ac.</
li
>
</
ol
>
<
p
>Volutpat volutpat lorem. Vivamus luctus lorem et iaculis porttitor.</
p
>
The attached images show the text being edited and the result after being exported into a document.