fix: protocol-relative URLs being accidentally munged, #13592

This commit is contained in:
Julian Lam
2025-08-13 10:01:05 -04:00
parent 673896390f
commit cc6fd49c4d

View File

@@ -88,7 +88,7 @@ module.exports = function (Posts) {
while (current !== null) { while (current !== null) {
if (current[1]) { if (current[1]) {
try { try {
parsed = url.parse(current[1]); parsed = new URL(current[1]);
if (!parsed.protocol) { if (!parsed.protocol) {
if (current[1].startsWith('/')) { if (current[1].startsWith('/')) {
// Internal link // Internal link