From 86c1f8f4cb2297ea3e50bb465bacf51406146122 Mon Sep 17 00:00:00 2001 From: olayway Date: Sun, 22 May 2022 19:52:13 +0200 Subject: [PATCH] [components/tooltip][s]: minor adjustment --- site/components/Tooltip.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/site/components/Tooltip.js b/site/components/Tooltip.js index 0046426..3237869 100644 --- a/site/components/Tooltip.js +++ b/site/components/Tooltip.js @@ -112,12 +112,11 @@ export const Tooltip = ({ render, ...props }) => { // create a temporary anchor tag to convert relative href to absolute path const tempLink = document.createElement("a"); tempLink.href = props.href; - // not all notes documents are structured so that the first paragraph will be the content summary - // TBD check if the docs can be adjusted and if previews for notes are even required - if (tempLink.pathname.includes('notes')) { + const filePath = tempLink.pathname.slice(1) // remove slash from the beginning + // disallow tooltips for 'notes' pages for now due to their different structure + if (filePath.includes('notes')) { return } - const filePath = tempLink.pathname.slice(1) // remove slash from the beginning const page = allOtherPages.find(p => p._raw.sourceFilePath === filePath) content = documentExtract(page.body.raw); } catch {