From 6adee9be5f37672f2fdaa53035ffcc88a881a1cc Mon Sep 17 00:00:00 2001 From: Frederic Heem Date: Mon, 9 Sep 2024 21:31:41 -0300 Subject: [PATCH] fix drilldown with md links --- bau-ui/drillDownMenu/drillDownMenu.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bau-ui/drillDownMenu/drillDownMenu.js b/bau-ui/drillDownMenu/drillDownMenu.js index 7b7f44d4..89d637b5 100644 --- a/bau-ui/drillDownMenu/drillDownMenu.js +++ b/bau-ui/drillDownMenu/drillDownMenu.js @@ -224,8 +224,11 @@ export default function (context, options = {}) { }; const pathFromHref = ({ target }) => { - const href = target.closest("a").getAttribute("href"); - let path = href.replace(baseUrl, ""); + let path = `${target + .closest("a") + .pathname.replace(".md", "") + .replace(baseUrl, "")}${target.hash}`; + if (!hashBased) { path = path.replace(target.hash, ""); } @@ -257,7 +260,6 @@ export default function (context, options = {}) { const anchor = target.closest("a"); if (!anchor) return; const href = anchor.getAttribute("href"); - if ( href && !href.startsWith("http") &&