Render HyperLink for all links; allow any valid URI scheme

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-24 16:38:24 +00:00
parent 3daf49cb52
commit dbc16f9f63
2 changed files with 2 additions and 4 deletions
@@ -79,7 +79,7 @@ public class MarkdownToInlinesConverter : IValueConverter
break; break;
} }
case LinkInline link when !string.IsNullOrWhiteSpace(link.Url): case LinkInline link:
{ {
inlines.Add( inlines.Add(
new InlineUIContainer( new InlineUIContainer(
@@ -59,9 +59,7 @@ public partial class HyperLink : UserControl
Command.Execute(CommandParameter); Command.Execute(CommandParameter);
} }
else if ( else if (
!string.IsNullOrWhiteSpace(Url) !string.IsNullOrWhiteSpace(Url) && Uri.TryCreate(Url, UriKind.Absolute, out var uri)
&& Uri.TryCreate(Url, UriKind.Absolute, out var uri)
&& (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps)
) )
{ {
Process.StartShellExecute(uri.AbsoluteUri); Process.StartShellExecute(uri.AbsoluteUri);