From 9a17a5014cca192c2b223bbe7a9127224c7f55e5 Mon Sep 17 00:00:00 2001 From: Ike Saunders Date: Thu, 5 Oct 2023 17:15:56 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20buildReplacerFunction=20re?= =?UTF-8?q?placing=20with=20full=20article=20text=20when=20reusable=20bloc?= =?UTF-8?q?k=20ID=20not=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/syncPostsToGrapher.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/db/syncPostsToGrapher.ts b/db/syncPostsToGrapher.ts index 565ad55a159..d248535331f 100644 --- a/db/syncPostsToGrapher.ts +++ b/db/syncPostsToGrapher.ts @@ -30,7 +30,7 @@ type ReplacerFunction = ( _match: string, _firstPattern: string, _offset: number, - fullString: string, + _fullString: string, matches: Record ) => string @@ -45,12 +45,11 @@ function buildReplacerFunction( _match: string, _firstPattern: string, _offset: number, - fullString: string, + _fullString: string, matches: Record ) => { const block = blocks[matches["id"].toString()] - if (block) return block.post_content - else return fullString + return block ? block.post_content : "" } }