Skip to content

Commit

Permalink
Fix for issue Code52#91
Browse files Browse the repository at this point in the history
  • Loading branch information
kryptx committed Jan 31, 2012
1 parent 9528664 commit ce5650a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/MarkPad/Document/DocumentView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public DocumentView()
InitializeComponent();
Loaded += DocumentViewLoaded;
wb.Loaded += WbLoaded;
wb.OpenExternalLink += WebControl_LinkClicked;

SizeChanged += new SizeChangedEventHandler(DocumentViewSizeChanged);

Expand All @@ -57,6 +58,11 @@ public DocumentView()
CommandBindings.Add(new CommandBinding(FormattingCommands.SetHyperlink, (x, y) => SetHyperlink(), CanEditDocument));
}

void WebControl_LinkClicked(object sender, Awesomium.Core.OpenExternalLinkEventArgs e)
{
System.Diagnostics.Process.Start(e.Url);
}

void TextView_VisualLinesChanged(object sender, EventArgs e)
{
DoSpellCheck();
Expand Down
5 changes: 5 additions & 0 deletions src/MarkPad/Document/ParsedDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ static class DocumentParser
{
private static readonly Markdown markdown = new Markdown();

static DocumentParser()
{
markdown.NewWindowForExternalLinks = true;
}

public static string Parse(string source)
{
const string delimiter = "---";
Expand Down

0 comments on commit ce5650a

Please sign in to comment.