diff --git a/src/lib/utils/metadata.ts b/src/lib/utils/metadata.ts
index 3a2aadb28e2..ecb441f8b04 100644
--- a/src/lib/utils/metadata.ts
+++ b/src/lib/utils/metadata.ts
@@ -13,15 +13,21 @@ export function buildOpenGraphImage(title: string, description: string): string
)}&subtitle=${encodeURIComponent(description)}`;
}
+/**
+ * Escapes `<` as the JSON unicode escape `\u003c` so the result can be embedded
+ * inside HTML ``
+ * or similar sequences in string values ending the script early. `JSON.parse`
+ * still yields the original `<`.
+ */
+export function escapeJsonLtForHtmlScript(json: string): string {
+ return json.replace(/` inside string values
- * (e.g. code samples in forum posts) cannot prematurely close the script element
- * in HTML; JSON.parse still yields the original `<`.
*/
export function getInlinedScriptTag(jsonSchema: string): string {
- const safeForInlineScript = jsonSchema.replace(/${safeForInlineScript}` + 'script>';
}
@@ -43,7 +49,7 @@ export function organizationJsonSchema() {
legalName: 'Appwrite Code Ltd.',
description:
'A secure open-source backend server provides the core APIs required to build web and mobile applications. Appwrite provides authentication, database, storage, functions, messaging, and advanced realtime capabilities.',
- logo: 'https://appwrite.io/assets/logotype/white.avif'
+ logo: 'https://appwrite.io/assets/logotype/white.png'
});
}
@@ -246,5 +252,5 @@ export function createDiscussionForumPageSchema(options: {
mainEntity
};
- return JSON.stringify(graph);
+ return escapeJsonLtForHtmlScript(JSON.stringify(graph));
}
diff --git a/src/routes/(marketing)/+page.svelte b/src/routes/(marketing)/+page.svelte
index 6112d4d625d..39e5d4162b2 100644
--- a/src/routes/(marketing)/+page.svelte
+++ b/src/routes/(marketing)/+page.svelte
@@ -1,5 +1,14 @@