I am having an issue when I paste HTML to the RichTextEditor. I have overriden my Derfault Paragraph Settings but I still get weird margins on empty <p> tags. I have a table I am pasting from a web page that has some empty columns <td></td> and when that happens it automatically inserts a <p> </p> and it assigns it a margin of 6px? I do not know why. Here are my paragraph settings:
var settings = new Infragistics.Documents.RichText.ParagraphSettings(); settings.Spacing = new Infragistics.Documents.RichText.ParagraphSpacingSettings(); settings.Spacing.LineSpacing = new Infragistics.Documents.RichText.LineSpacing(new Extent(0, ExtentUnitType.LogicalPixels), ExtentRule.Exact); settings.Spacing.AfterParagraph = new Infragistics.Documents.RichText.ParagraphVerticalSpacing(new Extent(0, ExtentUnitType.LogicalPixels)); settings.Spacing.BeforeParagraph = new Infragistics.Documents.RichText.ParagraphVerticalSpacing(new Extent(0, ExtentUnitType.LogicalPixels)); settings.WordWrap = true; return settings;
Any advice is appreciated
Hi Carson,
Are you directly pasting the HTML text into the rich text editor? Currently if I copy the following HTML it displays it the same way in the rich text editor:
<table style="width:100%"> <tr> <td></td> <td></td> <td>50</td> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>94</td> </tr></table>
I don't see any weird margins or the <p> </p> text getting automatically inserted. Maybe I'm not understanding what the exact issue is? I attached the sample I used for testing this. There isn't much to it. I just have the RichTextEditor in the window and I apply the ParagraphSettings you created to the RootNode.Settings.DefaultParagraphSettings.
I edited and re-attached the project sample. Inside is some HTML. Render that HTML into chrome or any other browser then paste the source into the control. You will see the middle, empty row has random margins and spacing. Why?