Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

fix: fix twitter renderer

Mohamed Bassemdc268202ceb8
diff --git a/patches/[email protected] b/patches/[email protected]
new file mode 100644
index 00000000..9cda8c64
--- /dev/null
+++ b/patches/[email protected]
@@ -0,0 +1,16 @@
+diff --git a/dist/utils.js b/dist/utils.js
+index d3624f5836f65a302f4450e55cdab0ae253944b0..19e80cc91ca98ec20d6dfc2ddc2e5519d9cdd303 100644
+--- a/dist/utils.js
++++ b/dist/utils.js
+@@ -81,7 +81,10 @@ function getEntities(tweet) {
+ });
+ }
+ function addEntities(result, type, entities) {
+- for (const entity of entities){
++ // Work around object-shaped entity buckets returned by the Twitter
++ // syndication API: https://github.com/vercel/react-tweet/issues/218
++ const entityList = Array.isArray(entities) ? entities : Object.values(entities ?? {}).flat();
++ for (const entity of entityList){
+ for (const [i, item] of result.entries()){
+ if (item.indices[0] > entity.indices[0] || item.indices[1] < entity.indices[1]) {
+ continue;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0d8b5b2a..e466d125 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -6,6 +6,7 @@ settings:
patchedDependencies:
[email protected]: cc2a1c1903e66d7f6cea77c615cb9ae3b36a694502c1c588c3e34d28aa925aac
+ [email protected]: d7b79c3ae412d8e700a8c176df42ee89112c9bdc91d2aad0ebb7d5b011b49993
[email protected]: 725863c0591d89ca053226c49fe7bc321f320391ec5f78b6c2e8e41ab1868805
importers:
@@ -745,7 +746,7 @@ importers:
version: 15.5.0([email protected])
react-tweet:
specifier: ^3.2.2
+ version: 3.2.2(patch_hash=d7b79c3ae412d8e700a8c176df42ee89112c9bdc91d2aad0ebb7d5b011b49993)([email protected]([email protected]))([email protected])
remark-breaks:
specifier: ^4.0.0
version: 4.0.0
@@ -33344,7 +33345,7 @@ snapshots:
react: 19.2.6
react-dom: 19.2.6([email protected])
+ [email protected](patch_hash=d7b79c3ae412d8e700a8c176df42ee89112c9bdc91d2aad0ebb7d5b011b49993)([email protected]([email protected]))([email protected]):
dependencies:
'@swc/helpers': 0.5.5
clsx: 2.1.0
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 815bb6cd..f31bc45b 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -23,6 +23,7 @@ allowBuilds:
protobufjs: false
patchedDependencies: