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

added check empty for safety reason

This commit is contained in:
Nguyễn Việt Hưng
2019-04-21 11:11:35 +12:00
committed by Junyoung Choi
parent 48bb9d3242
commit 156a2c6521

View File

@@ -1003,6 +1003,8 @@ export default class MarkdownPreview extends React.Component {
const href = e.target.getAttribute('href')
const linkHash = href.split('/').pop()
if (!href) return
const regexNoteInternalLink = /main.html#(.+)/
if (regexNoteInternalLink.test(linkHash)) {
const targetId = mdurl.encode(linkHash.match(regexNoteInternalLink)[1])