mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-12 19:50:39 +00:00
fix popover regex
This commit is contained in:
parent
d46e223831
commit
54e3e071d1
2 changed files with 2 additions and 2 deletions
layouts/partials
|
@ -7,10 +7,11 @@
|
|||
return template.content.firstChild
|
||||
}
|
||||
|
||||
const pathRegex = /\.\.(\/\.\.)*/
|
||||
const pathRegex = /\.\.?(\/\.\.)*/
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
[...document.getElementsByClassName("internal-link")]
|
||||
.forEach(li => {
|
||||
console.log(li.dataset.src.replace(pathRegex, ''))
|
||||
const linkDest = content[li.dataset.src.replace(pathRegex, '')]
|
||||
if (linkDest) {
|
||||
const popoverElement = `<div class="popover">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue