1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Fix #1797: In preview window, open external link in external browser.

This commit is contained in:
Chen Shenghan
2018-04-24 02:51:58 +12:00
parent 1f1ef1440e
commit 6ec2124a9c

View File

@@ -523,6 +523,15 @@ export default class MarkdownPreview extends React.Component {
}
handlelinkClick (e) {
e.preventDefault()
e.stopPropagation()
const href = e.target.href
if (href.match(/^http/i)) {
shell.openExternal(href)
return
}
const noteHash = e.target.href.split('/').pop()
// this will match the new uuid v4 hash and the old hash
// e.g.