卡片URL调整

This commit is contained in:
tlyong1992
2022-06-08 11:12:10 +08:00
parent 4635c1b7d0
commit 00343cd77b

View File

@@ -58,15 +58,14 @@ const NotionPage = ({ post }) => {
}
}
// 相册中的url替换成可点击
const cards = document.getElementsByClassName('notion-collection-card')
for (const e of cards) {
e.removeAttribute('href')
const links = e.querySelectorAll('.notion-link')
if (links && links.length > 0) {
for (const l of links) {
l.onclick = function() {
window.open('http://' + l.innerText)
}
l.parentElement.innerHTML = `<a href='${l.innerText}' rel='noreferrer' target='_blank'>${l.innerText}</a>`
}
}
}
@@ -74,7 +73,7 @@ const NotionPage = ({ post }) => {
}, 800)
addWatch4Dom()
})
}, [])
return <div id='container' className='max-w-4xl mx-auto'>
<NotionRenderer