ui/richtext/bases/RichTextNewline.razor

A Blazor-style Sandbox UI component file that defines a RichText newline panel. It implements IRichTextPanel and serves as a no-op line break so the RichText parser does not emit a Label for "\n".

File Access
@namespace Sandbox
@inherits Panel
@using Sandbox.UI
@implements IRichTextPanel
@attribute [RichTextPanel( @"\n" )]

<root>
</root>

<style>
	RichTextNewline
	{
		width: 100%;
		flex-shrink: 1;
	}
</style>

@code {
	public float? ImageSize { get; set; }

	// This panel is only a line break. Implementing IRichTextPanel stops the RichText
	// parser from adding a Label whose text is just "\n" - the engine's TextBlock.Measure
	// collapses that to empty text but still indexes Lines[^1], which throws.
	public void ParseRichText( string text )
	{
	}
}