Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/components/PageLinks/PageLinks.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// eslint-disable-next-line n/prefer-node-protocol
import Url from "url";
import PropTypes from "prop-types";

const baseURL = "https://github.com/webpack/webpack.js.org/edit/main/";
Expand All @@ -21,8 +19,7 @@ function _handlePrintClick(event) {
}

export default function PageLinks({ page = {} }) {
// eslint-disable-next-line n/no-deprecated-api
const editLink = page.edit || Url.resolve(baseURL, page.path);
const editLink = page.edit || new URL(page.path, baseURL).href;

return (
<div className="print:hidden mt-8">
Expand Down
4 changes: 1 addition & 3 deletions src/utilities/process-readme.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import url from "node:url";
import { excludedLoaders, excludedPlugins } from "./constants.mjs";

const beginsWithDocsDomainRegex = /^(?:https?:)\/\/webpack\.js\.org/;
Expand Down Expand Up @@ -40,8 +39,7 @@ function linkFixerFactory(sourceUrl) {
.replace(/raw.githubusercontent.com/, "github.com")
.replace(/master/, "blob/master");

// eslint-disable-next-line n/no-deprecated-api
href = url.resolve(renderedUrl, href);
href = new URL(href, renderedUrl).href;
}

// Modify absolute documentation links to be root relative
Expand Down
Loading