1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Merge pull request #1858 from zzdjk6/master

Fix #1797: In preview window, open external link in external browser.
This commit is contained in:
Junyoung Choi (Sai)
2018-04-24 04:58:25 +09:00
committed by GitHub

View File

@@ -523,6 +523,15 @@ export default class MarkdownPreview extends React.Component {
} }
handlelinkClick (e) { 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() const noteHash = e.target.href.split('/').pop()
// this will match the new uuid v4 hash and the old hash // this will match the new uuid v4 hash and the old hash
// e.g. // e.g.