Skip to content

Commit

Permalink
Merge pull request #2706 from owid/entry-emulator-length
Browse files Browse the repository at this point in the history
🐛 fix Grapher WP ReusableBlock resolver bug
  • Loading branch information
ikesau authored Oct 10, 2023
2 parents 9753070 + 9a17a50 commit 1a63add
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions db/syncPostsToGrapher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type ReplacerFunction = (
_match: string,
_firstPattern: string,
_offset: number,
fullString: string,
_fullString: string,
matches: Record<string, string>
) => string

Expand All @@ -45,12 +45,11 @@ function buildReplacerFunction(
_match: string,
_firstPattern: string,
_offset: number,
fullString: string,
_fullString: string,
matches: Record<string, string>
) => {
const block = blocks[matches["id"].toString()]
if (block) return block.post_content
else return fullString
return block ? block.post_content : ""
}
}

Expand Down

0 comments on commit 1a63add

Please sign in to comment.