From 621d39ad7c2ca5a159feb4e41c67a8b6bfe82b86 Mon Sep 17 00:00:00 2001 From: Nazar Leush Date: Thu, 28 May 2026 21:13:51 +0300 Subject: [PATCH] fix `readabilitySAX` resolving fragment url --- package.json | 5 +++++ patches/readabilitySAX@1.6.1.patch | 14 +++++++++++++ patches/spdy-transport+3.0.0.patch | 33 ------------------------------ pnpm-lock.yaml | 9 ++++++-- pnpm-workspace.yaml | 2 ++ 5 files changed, 28 insertions(+), 35 deletions(-) create mode 100644 patches/readabilitySAX@1.6.1.patch delete mode 100644 patches/spdy-transport+3.0.0.patch diff --git a/package.json b/package.json index 102846666..cfc837197 100644 --- a/package.json +++ b/package.json @@ -68,5 +68,10 @@ }, "engines": { "node": ">=20.19.3" + }, + "pnpm": { + "patchedDependencies": { + "readabilitySAX@1.6.1": "patches/readabilitySAX@1.6.1.patch" + } } } diff --git a/patches/readabilitySAX@1.6.1.patch b/patches/readabilitySAX@1.6.1.patch new file mode 100644 index 000000000..c7232e567 --- /dev/null +++ b/patches/readabilitySAX@1.6.1.patch @@ -0,0 +1,14 @@ +diff --git a/readabilitySAX.js b/readabilitySAX.js +index d3b6d3bf37e64224c7241d8c38e2f078d0ff0ce1..1b3c64e2c73da9866d1ff8ac0fc3416e0e1432f9 100644 +--- a/readabilitySAX.js ++++ b/readabilitySAX.js +@@ -213,6 +213,9 @@ Readability.prototype._convertLinks = function(path){ + if(!this._url) return path; + if(!path) return this._url.full; + ++ // Fragment-only references resolve to the current page URL + fragment ++ if(path.charAt(0) === '#') return this._url.full + path; ++ + var path_split = path.split("/"); + + //special cases diff --git a/patches/spdy-transport+3.0.0.patch b/patches/spdy-transport+3.0.0.patch deleted file mode 100644 index c79d7db59..000000000 --- a/patches/spdy-transport+3.0.0.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/node_modules/spdy-transport/lib/spdy-transport/protocol/base/utils.js b/node_modules/spdy-transport/lib/spdy-transport/protocol/base/utils.js -index 72a380f..042199e 100644 ---- a/node_modules/spdy-transport/lib/spdy-transport/protocol/base/utils.js -+++ b/node_modules/spdy-transport/lib/spdy-transport/protocol/base/utils.js -@@ -45,13 +45,13 @@ exports.addHeaderLine = function addHeaderLine (field, value, dest) { - - switch (field) { - // Array headers: -- case 'set-cookie': -- if (dest[field] !== undefined) { -- dest[field].push(value) -- } else { -- dest[field] = [ value ] -- } -- break -+ // case 'set-cookie': -+ // if (dest[field] !== undefined) { -+ // dest[field].push(value) -+ // } else { -+ // dest[field] = [ value ] -+ // } -+ // break - - /* eslint-disable max-len */ - // list is taken from: -@@ -74,6 +74,7 @@ exports.addHeaderLine = function addHeaderLine (field, value, dest) { - } - break - -+ case 'set-cookie': - case 'cookie': - // make semicolon-separated list - if (dest[field] !== undefined) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f127aac8e..fd7f05e26 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,11 @@ overrides: underscore@<=1.13.7: '>=1.13.8' undici@>=7.0.0 <7.24.0: '>=7.24.0' +patchedDependencies: + readabilitySAX@1.6.1: + hash: 13d40f78c0537e2538fd3a338f5ead833d968e2a80882e92f1eb3580b599c757 + path: patches/readabilitySAX@1.6.1.patch + importers: .: @@ -95,7 +100,7 @@ importers: version: 7.2.3 readabilitySAX: specifier: 1.6.1 - version: 1.6.1 + version: 1.6.1(patch_hash=13d40f78c0537e2538fd3a338f5ead833d968e2a80882e92f1eb3580b599c757) redis: specifier: ^4.6.14 version: 4.6.14 @@ -2338,7 +2343,7 @@ snapshots: iconv-lite: 0.7.0 unpipe: 1.0.0 - readabilitySAX@1.6.1: + readabilitySAX@1.6.1(patch_hash=13d40f78c0537e2538fd3a338f5ead833d968e2a80882e92f1eb3580b599c757): dependencies: entities: 0.5.0 htmlparser2: 3.0.5 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4826d41a1..92efcd5c8 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -13,3 +13,5 @@ overrides: serialize-javascript@<7.0.5: '>=7.0.5' underscore@<=1.13.7: '>=1.13.8' undici@>=7.0.0 <7.24.0: '>=7.24.0' +patchedDependencies: + readabilitySAX@1.6.1: patches/readabilitySAX@1.6.1.patch