CI / check (push) Successful in 29s
CI / tests-unit (push) Successful in 2m17s
CI / tests-integration (push) Successful in 2m29s
CI / tests-imaging-browsers (push) Successful in 2m32s
CI / tests-quality (push) Failing after 2m18s
CI / tests-ui (push) Successful in 5m14s
CI / preflight (push) Skipped
CI / deploy (push) Successful in 2m41s
22 lines
460 B
TypeScript
22 lines
460 B
TypeScript
/**
|
|
* Renders schema.org JSON-LD. The payload is data, not executable script, but
|
|
* `<` is escaped so an article title can never terminate the tag early.
|
|
*/
|
|
export function JsonLd({
|
|
data,
|
|
nonce,
|
|
}: {
|
|
data: Record<string, unknown> | Record<string, unknown>[];
|
|
nonce?: string;
|
|
}) {
|
|
return (
|
|
<script
|
|
type="application/ld+json"
|
|
nonce={nonce}
|
|
dangerouslySetInnerHTML={{
|
|
__html: JSON.stringify(data).replace(/</g, "\\u003c"),
|
|
}}
|
|
/>
|
|
);
|
|
}
|