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