[components/tooltip][s]: minor adjustment
This commit is contained in:
parent
40a51ac22b
commit
86c1f8f4cb
|
|
@ -112,12 +112,11 @@ export const Tooltip = ({ render, ...props }) => {
|
||||||
// create a temporary anchor tag to convert relative href to absolute path
|
// create a temporary anchor tag to convert relative href to absolute path
|
||||||
const tempLink = document.createElement("a");
|
const tempLink = document.createElement("a");
|
||||||
tempLink.href = props.href;
|
tempLink.href = props.href;
|
||||||
// not all notes documents are structured so that the first paragraph will be the content summary
|
const filePath = tempLink.pathname.slice(1) // remove slash from the beginning
|
||||||
// TBD check if the docs can be adjusted and if previews for notes are even required
|
// disallow tooltips for 'notes' pages for now due to their different structure
|
||||||
if (tempLink.pathname.includes('notes')) {
|
if (filePath.includes('notes')) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const filePath = tempLink.pathname.slice(1) // remove slash from the beginning
|
|
||||||
const page = allOtherPages.find(p => p._raw.sourceFilePath === filePath)
|
const page = allOtherPages.find(p => p._raw.sourceFilePath === filePath)
|
||||||
content = documentExtract(page.body.raw);
|
content = documentExtract(page.body.raw);
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue