You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you use the markdown component and give as input a null value or an empty string the whole component won't work anymore because it throws an ArgumentOutOfException exception.
clear the complete text from the markdown textarea
the preview won't render anymore if you type valid markdown in the textarea
OR <Markdown style="max-height: 437px;overflow-y:auto;"> @string.Empty </Markdown>
Expected behavior
display an empty string if the input is null or an empty string
Screenshots
When debugging in VS 2022 the problem lies in the GetLines() function in Markdown.cs when list.Count = 0 and the function tries ao access an item at position -1.
Versions (please complete the following information):
.NET Version: .NET 9
BlazorBootstrap: 3.2.0
Blazor WebAssembly / Server: Blazor Server
Blazor Interactive Render Mode: Server
Sample code
Sample code to reproduce the issue.
GitHub repo
GitHub repo with minimal code to reproduce the issue.
Desktop (please complete the following information):
OS: Windows 10
Browser Chrome
Version 131
The text was updated successfully, but these errors were encountered:
andreaspipp
changed the title
Problem with MarkdownComponent when Input is null or string.empty
problem with markdown component when input is null or string.empty
Dec 11, 2024
Describe the bug
If you use the markdown component and give as input a null value or an empty string the whole component won't work anymore because it throws an ArgumentOutOfException exception.
To Reproduce
OR
<Markdown style="max-height: 437px;overflow-y:auto;"> @string.Empty </Markdown>
Expected behavior
display an empty string if the input is null or an empty string
Screenshots
When debugging in VS 2022 the problem lies in the GetLines() function in Markdown.cs when list.Count = 0 and the function tries ao access an item at position -1.
Versions (please complete the following information):
Sample code
Sample code to reproduce the issue.
GitHub repo
GitHub repo with minimal code to reproduce the issue.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: