Closed eamon-otuathail closed 3 years ago
The react-schemaorg project (also by the hard-working Eyas) has a useful function safeJsonLdReplacer() in: https://github.com/google/react-schemaorg/blob/master/src/json-ld.tsx
safeJsonLdReplacer() is not React specific, but is general to any solution working with HTML and JSON-LD: https://www.w3.org/TR/json-ld11/#restrictions-for-contents-of-json-ld-script-elements
For folks who do use schema-dts-gen but don't use React (e.g. those who use Angular 12) it would be handy if safeJsonLdReplacer() were added to the generated code created by schema-dts-gen, so all can use it when needed.
The react-schemaorg project (also by the hard-working Eyas) has a useful function safeJsonLdReplacer() in: https://github.com/google/react-schemaorg/blob/master/src/json-ld.tsx
safeJsonLdReplacer() is not React specific, but is general to any solution working with HTML and JSON-LD: https://www.w3.org/TR/json-ld11/#restrictions-for-contents-of-json-ld-script-elements
For folks who do use schema-dts-gen but don't use React (e.g. those who use Angular 12) it would be handy if safeJsonLdReplacer() were added to the generated code created by schema-dts-gen, so all can use it when needed.