layouts/partials/popover.html
@@ -1,5 +1,7 @@ {{if $.Site.Data.config.enableLinkPreview}} <script> async function run() { const {content} = await fetchData() function htmlToElement(html) { const template = document.createElement('template') html = html.trim() @@ -7,7 +9,7 @@ return template.content.firstChild } const pathRegex = /\.\.(\/\.\.)*/ const pathRegex = /\.\.?(\/\.\.)*/ document.addEventListener("DOMContentLoaded", () => { [...document.getElementsByClassName("internal-link")] .forEach(li => { @@ -28,5 +30,8 @@ } }) }) } run() </script> {{end}}