[chore:] logging for MarkdownRenderer.cs

This commit is contained in:
2026-05-16 18:19:27 +02:00
parent 557052bbc7
commit c6baa6a187
+11
View File
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using Avalonia.Controls;
using Avalonia.Media;
@@ -11,6 +12,8 @@ namespace Logof_Client.Wiki;
public static class MarkdownRenderer
{
public static Control Render(string markdown)
{
try
{
var panel = new StackPanel { Spacing = 6 };
if (string.IsNullOrWhiteSpace(markdown)) return panel;
@@ -93,9 +96,14 @@ public static class MarkdownRenderer
}
return panel;
} catch (Exception ex) { Logger.Log($"Error while : {ex.Message}",Logger.LogType.Error);}
return new Panel();
}
private static string GetInlineText(ContainerInline? container)
{
try
{
if (container == null) return string.Empty;
var sb = new StringBuilder();
@@ -125,5 +133,8 @@ public static class MarkdownRenderer
}
return sb.ToString();
} catch (Exception ex) { Logger.Log($"Error while : {ex.Message}",Logger.LogType.Error);}
return null;
}
}