From 3622e7590302da4ce841fbe8a3206b2d2c7b8769 Mon Sep 17 00:00:00 2001 From: Pamela Chia Date: Tue, 5 May 2026 22:38:24 +0800 Subject: [PATCH] fix(www): inline brand Organization on pricing Product schema Replaces dangling @id reference (resolved only on the homepage's Organization node) with an inline Organization object so Google's Product rich-results validator can resolve brand without cross-page context. Also renames markdownAnswerToText to stripMarkdownLinks to match what the helper actually does. --- apps/www/lib/json-ld.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/www/lib/json-ld.ts b/apps/www/lib/json-ld.ts index a1fbca3eae..9247bb3db3 100644 --- a/apps/www/lib/json-ld.ts +++ b/apps/www/lib/json-ld.ts @@ -128,7 +128,7 @@ interface FaqEntry { answer: string } -function markdownAnswerToText(markdown: string): string { +function stripMarkdownLinks(markdown: string): string { return markdown.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1').trim() } @@ -141,7 +141,7 @@ export function faqPageSchema(entries: FaqEntry[]) { name: entry.question, acceptedAnswer: { '@type': 'Answer', - text: markdownAnswerToText(entry.answer), + text: stripMarkdownLinks(entry.answer), }, })), } @@ -195,7 +195,10 @@ export function pricingProductSchema(input: PricingProductSchemaInput) { description: input.description, image: input.image, url: input.url, - brand: { '@id': ORG_ID }, + brand: { + '@type': 'Organization', + name: SITE_NAME, + }, offers, ...(customPlans.length > 0 && { additionalProperty: customPlans.map((plan) => ({