Scenario 1:
The <br/> tags after </li> are treated as separate paragraphs and inherit the list styling of the previous paragraphs resulting in duplicate bullets.
Workaround:
var paragraphsToRemove = this.radRichTextBox.Document.EnumerateChildrenOfType<Paragraph>().Where(p => p.IsInList && p.Inlines.First() is Break);
foreach (var p in paragraphsToRemove)
{
p.ListId = -1;
}
this.radRichTextBox.UpdateEditorLayout();
Scenario 2:
The <br/> tags added as the last element of <li> are treated as break elements in the content, causing additional new lines in the document.
Workaround:
var paragraphsWithLineBreak = document.EnumerateChildrenOfType<Paragraph>().Where(p => p.IsInList && p.Inlines.Last() is Break);
foreach (var p in paragraphsWithLineBreak)
{
p.Inlines.Remove(p.Inlines.Last);
}
this.richtextbox.Document = document;
Some fonts doesn't include bold and italic font styles. Currently text formatted with such fonts and with applied bold or italic formatting is exported without the italic or bold effect. Instead, the default typeface can be exported, and additional transformation could be applied to the letters itself - e.g. skew transform for the italic.
In localizing your demo code for a RichTextBox I noticed some size mode-related inconsistencies in icon placements in the various sorts of buttons:
In Size=large, generally the icon appears above the button text. In the split button the icon is centered over and partially obscures the text. Unacceptable!
In Size=medium, generally the icon appears to the left of the text. In the Split button it appears below the text. Either is fine but should be consistent.
Also, when Size=medium and icon beside text, in all buttons I would like to see more spacing between the icon and the text; there seems to be virtually none.
Currently, the only customization that can be performed is using HyperlinkToolTipFormatString property of RadRichTextBox, which sets the format for all hyperlinks in the document of the control. It would be nice if it were possible to be able to set different tooltips.
A reference in DocumentFragment to RadDocument (CopySource property) can cause a memory after copy-paste between RadDocument.
Workaround:
public static bool ReleaseClipboardExReferences(
RadDocument document)
{
dynamic clipboardEx = new DynamicProxyObject(typeof(ClipboardEx));
if (clipboardEx.documentClipboardData?.CopySource is DynamicProxyObject copySource
&& object.ReferenceEquals(copySource.Instance, document))
{
clipboardEx.documentClipboardData = null;
return true;
}
if (clipboardEx.CopiedDocumentFragment?.Fragment?.CopySource is DynamicProxyObject fragmentCopySource
&& object.ReferenceEquals(fragmentCopySource.Instance, document))
{
clipboardEx.CopiedDocumentFragment = null;
return true;
}
return false;
}