diff --git a/src/Markdowser/Commands/HyperlinkCommand.cs b/src/Markdowser/Commands/HyperlinkCommand.cs index 1e3e4cf..c6e95a0 100644 --- a/src/Markdowser/Commands/HyperlinkCommand.cs +++ b/src/Markdowser/Commands/HyperlinkCommand.cs @@ -1,6 +1,8 @@ using Markdowser.Utilities; using System; +using System.Diagnostics; +using System.IO; using System.Windows.Input; namespace Markdowser.Commands; @@ -32,6 +34,22 @@ public class HyperlinkCommand : ICommand { GlobalState.CurrentTabState.Url = new Uri(new Uri(GlobalState.CurrentTabState.Url), url).ToString(); } + else if (File.Exists(url)) + { + ProcessStartInfo processStartInfo = new() + { + FileName = url, + UseShellExecute = true + }; + try + { + _ = Process.Start(processStartInfo); + } + catch (Exception ex) + { + GlobalState.Logger.LogError(ex.Message); + } + } else { GlobalState.Logger.LogDebug($"Invalid URL: {url}");