Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit ffafd4d

Browse files
Merge pull request #2091 from github/check-run-annotation-view-markdown-links
Fixing CheckRun details markdown links
2 parents c2f8b3e + 5eddcbc commit ffafd4d

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/GitHub.VisualStudio.UI/Views/GitHubPane/PullRequestAnnotationsView.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,8 @@
129129
</DockPanel>
130130
</ScrollViewer>
131131

132+
<FrameworkElement.CommandBindings>
133+
<CommandBinding Command="{x:Static markdig:Commands.Hyperlink}" Executed="OpenHyperlink" />
134+
</FrameworkElement.CommandBindings>
132135
</UserControl>
133136

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
using System;
22
using System.ComponentModel.Composition;
3-
using System.Windows.Forms;
3+
using System.Windows.Controls;
4+
using System.Windows.Input;
45
using GitHub.Exports;
56
using GitHub.Services;
6-
using GitHub.UI;
77
using GitHub.ViewModels.GitHubPane;
8-
using ReactiveUI;
9-
using UserControl = System.Windows.Controls.UserControl;
8+
using Microsoft.VisualStudio.Shell;
109

1110
namespace GitHub.VisualStudio.Views.GitHubPane
1211
{
@@ -18,5 +17,18 @@ public PullRequestAnnotationsView()
1817
{
1918
InitializeComponent();
2019
}
20+
21+
void OpenHyperlink(object sender, ExecutedRoutedEventArgs e)
22+
{
23+
Uri uri;
24+
25+
if (Uri.TryCreate(e.Parameter?.ToString(), UriKind.Absolute, out uri))
26+
{
27+
Browser.OpenUrl(uri);
28+
}
29+
}
30+
31+
[Import]
32+
public IVisualStudioBrowser Browser { get; set; }
2133
}
2234
}

0 commit comments

Comments
 (0)