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,
I think I see the spacing you are talking about. When I view the table in Chrome the empty row height is very small (it's still there though) and when I paste it into the xamRichTextEditor it ends up with a lot of space between the first and third row. While it is expected that there will be an empty row visible in the pasted table, I'm not sure if the height should be so large. I logged a development issue to have our engineers investigate this. The dev issue ID is 204925.
I also created a private support case for you so that I can link the dev issue to the case. This will let you track the status of the dev issue. The case number is CAS-159753-D5V0C8.
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?
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.