From 5a3e3a33fc1b8ba4166d72d27a9e2c2a228f147b Mon Sep 17 00:00:00 2001 From: Brychan Dempsey Date: Thu, 10 Jun 2021 00:21:00 +1200 Subject: [PATCH] Update 'RenderHTML.html' --- RenderHTML.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/RenderHTML.html b/RenderHTML.html index 3dfa63d..160e6f9 100644 --- a/RenderHTML.html +++ b/RenderHTML.html @@ -19,6 +19,7 @@ const urlParams = new URLSearchParams(queryString); const requestURL = urlParams.get('url') const selector = urlParams.get('selector') + var pageLink; // Fetch the content fetch(queryLoc + requestURL) .then(function (data) { @@ -47,7 +48,14 @@ // 2.) disable cross-origin requests var fixedURL = hlinks[i].href.replace(windowLoc.split('#')[0], "").replace(queryLoc, "") // If the remaining character is the hash, this is a same-page section link - if (fixedURL.startsWith("#")) { + // There are two cases here; + // 1.) The hash-url is just a typical page-link + // 2.) The hash-url is a page content reference + if (fixedURL.contains("#page=")) { + pageLink.add(fixedURL); + + } + else if (fixedURL.startsWith("#")){ fixedURL = requestURL + fixedURL; } // selector is the selector used to select the element. Use body if the whole page is required