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:
committed by
Junyoung Choi
parent
48bb9d3242
commit
156a2c6521
@@ -1003,6 +1003,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
const href = e.target.getAttribute('href')
|
const href = e.target.getAttribute('href')
|
||||||
const linkHash = href.split('/').pop()
|
const linkHash = href.split('/').pop()
|
||||||
|
|
||||||
|
if (!href) return
|
||||||
|
|
||||||
const regexNoteInternalLink = /main.html#(.+)/
|
const regexNoteInternalLink = /main.html#(.+)/
|
||||||
if (regexNoteInternalLink.test(linkHash)) {
|
if (regexNoteInternalLink.test(linkHash)) {
|
||||||
const targetId = mdurl.encode(linkHash.match(regexNoteInternalLink)[1])
|
const targetId = mdurl.encode(linkHash.match(regexNoteInternalLink)[1])
|
||||||
|
|||||||
Reference in New Issue
Block a user