diff --git a/src/components/JsonLd.astro b/src/components/JsonLd.astro
index 4866788..69c2a1e 100644
--- a/src/components/JsonLd.astro
+++ b/src/components/JsonLd.astro
@@ -1,4 +1,6 @@
---
+import { serializeJsonLd } from '../lib/json-ld.mjs';
+
const { data } = Astro.props;
---
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/lib/json-ld.mjs b/src/lib/json-ld.mjs
new file mode 100644
index 0000000..4180378
--- /dev/null
+++ b/src/lib/json-ld.mjs
@@ -0,0 +1,11 @@
+// JSON-LD for a &\u2028\u2029]/g;
+
+/**
+ * `data` as JSON, with `<`, `>`, `&`, U+2028 and U+2029 written as `\u` escapes. A string holding `` or ` > done',
+ description: 'Line\u2028and paragraph\u2029separators',
+ keywords: ['', 'a&b'],
+ };
+ const json = serializeJsonLd(data);
+ // With no `<` left, the browser can't find `&\u2028\u2029]/);
+ assert.match(json, /"Ends early \\u003c\/script\\u003e\\u003cb\\u003ex\\u003c\/b\\u003e \\u0026 \\u003c!-- comment/);
+ assert.match(json, /"Line\\u2028and paragraph\\u2029separators"/);
+ assert.deepEqual(JSON.parse(json), data);
+});
+
+test('JSON-LD without those characters is plain JSON.stringify', () => {
+ const data = { '@context': 'https://schema.org', name: 'meaningfool', sameAs: ['https://github.com/meaningfool'] };
+ assert.equal(serializeJsonLd(data), JSON.stringify(data));
+});