diff --git a/src/Symptum.UI/Markdown/TextElements/CodeBlockElement.cs b/src/Symptum.UI/Markdown/TextElements/CodeBlockElement.cs index 08b4eff..461d870 100644 --- a/src/Symptum.UI/Markdown/TextElements/CodeBlockElement.cs +++ b/src/Symptum.UI/Markdown/TextElements/CodeBlockElement.cs @@ -57,7 +57,7 @@ public CodeBlockElement(CodeBlock codeBlock, MarkdownConfiguration config) } } - formatter.FormatInlines(stringBuilder.ToString().TrimEnd(Environment.NewLine.AsSpan()), fencedCodeBlock.ToLanguage(), textBlock.Inlines); + formatter.FormatInlines(stringBuilder.ToString(), fencedCodeBlock.ToLanguage(), textBlock.Inlines); } else { @@ -68,7 +68,7 @@ public CodeBlockElement(CodeBlock codeBlock, MarkdownConfiguration config) if (i < codeBlock.Lines.Lines.Length - 1) stringBuilder.AppendLine(); } - textBlock.Text = stringBuilder.ToString().TrimEnd(Environment.NewLine.AsSpan()); + textBlock.Text = stringBuilder.ToString(); } border.Child = new ScrollViewer() { Content = textBlock, HorizontalScrollBarVisibility = ScrollBarVisibility.Auto }; _container.UIElement = border;