Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

JSON LD as script example in README.md seems misleading #303

@williamchong

Description

@williamchong

Currently the script example in README.md look like this

Each item in the array maps to a newly-created <script> element, where object properties map to attributes.

{
  metaInfo: {
    script: [
      { innerHTML: '{ "@context": "http://schema.org" }', type: 'application/ld+json' }
    ],
  }
}
<script type="application/ld+json">{ "@context": "http://schema.org" }</script>

This code would not work, as __dangerouslyDisableSanitizers is required for json-ld, but not shown in the example.

However for a simplescript example, putting __dangerouslyDisableSanitizers in seems too much complication, and might promote poor pratice of adding unneeded __dangerouslyDisableSanitizers. People might just take a quick glance at README for copy and paste, without really understanding what each line does.

Will we consider changing the script example to something more trivial, and put json ld as __dangerouslyDisableSanitizers example instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions