diff --git a/packages/@ourworldindata/utils/src/wordpressUtils.ts b/packages/@ourworldindata/utils/src/wordpressUtils.ts index c3cabab7880..294ee2b9eab 100644 --- a/packages/@ourworldindata/utils/src/wordpressUtils.ts +++ b/packages/@ourworldindata/utils/src/wordpressUtils.ts @@ -2,10 +2,13 @@ import { FormattingOptions, KeyValueProps } from "./owidTypes.js" export const extractFormattingOptions = (html: string): FormattingOptions => { const formattingOptionsMatch = html.match( - // + // ) + const innerFormattingOptions = formattingOptionsMatch + ? formattingOptionsMatch[1].trim() + : "" return formattingOptionsMatch - ? parseFormattingOptions(formattingOptionsMatch[1]) + ? parseFormattingOptions(innerFormattingOptions) : {} }