1bc2de655a
Uniform stock management for healthcare linen rooms. Licensed under the GNU AGPL v3.
10 lines
532 B
TypeScript
10 lines
532 B
TypeScript
/* Emits a JSON-LD block.
|
|
*
|
|
* A server component, so the markup is in the HTML a crawler is served rather than something it
|
|
* has to execute JavaScript to discover. The JSON is serialised rather than templated, and `<`
|
|
* is escaped so a stray character in any content string can't close the script tag early. */
|
|
export default function JsonLd({ data }: { data: object }) {
|
|
const json = JSON.stringify(data).replace(/</g, "\\u003c");
|
|
return <script type="application/ld+json" dangerouslySetInnerHTML={{ __html: json }} />;
|
|
}
|