Closed hansmbakker closed 22 hours ago
Hi, some quick suggestions to make code cleaner:
the Validations class is only used to check for Base64 validity which dotnet has a builtin function for. You could change https://github.com/0xc3u/Indiko.Maui.Controls.Markdown/blob/1c9e155bddff66fec29e613e4a59deb3e02f6f24/src/Indiko.Maui.Controls.Markdown/MarkdownView.cs#L898-L902
to
if (System.Buffers.Text.Base64.IsValid(imageUrl)) { byte[] imageBytes = Convert.FromBase64String(imageUrl); imageSource = ImageSource.FromStream(() => new MemoryStream(imageBytes)); }
and remove the Validations class.
InvertedBooleanConverter
Hi Hans,
Thank you for your suggestions. We will double-check them and keep you posted.
Hi, some quick suggestions to make code cleaner:
the Validations class is only used to check for Base64 validity which dotnet has a builtin function for. You could change https://github.com/0xc3u/Indiko.Maui.Controls.Markdown/blob/1c9e155bddff66fec29e613e4a59deb3e02f6f24/src/Indiko.Maui.Controls.Markdown/MarkdownView.cs#L898-L902
to
and remove the Validations class.
InvertedBooleanConverter
is included in the MAUI community toolkit - you could replace it with that