fix: trim trailing slash when calculating popover

This commit is contained in:
Jacky Zhao 2022-05-03 10:57:20 -04:00
parent b78c02c6f3
commit a1d03a044e

View File

@ -13,7 +13,7 @@ function initPopover(baseURL) {
links
.filter(li => li.dataset.src)
.forEach(li => {
const linkDest = content[li.dataset.src.replace(basePath, "")]
const linkDest = content[li.dataset.src.replace(/\/$/g, "").replace(basePath, "")]
if (linkDest) {
const popoverElement = `<div class="popover">
<h3>${linkDest.title}</h3>