Skip to content

html/template: "application/ld+json" MIME type is not understood as JS #26053

Closed
@eklitzke

Description

@eklitzke

The text/html package does not understand the "application/ld+json" MIME type to be JS. This is a standard format endorsed by the W3C and various search engines. Search engines like Google require this data to be inline in a page's HTML using a tag like <script type="application/ld+json">JSON DATA HERE</script>, so it is important for the text/html template engine to be aware of how to escape JSON-LD data, as the data cannot be placed in an external script file. For more information on JSON-LD see [1] and [2].

I plan to submit a trivial PR to add json+ld support to text/html, but I am creating a GitHub issue first to describe the issue as per the contribution policy.

[1] https://en.wikipedia.org/wiki/JSON-LD
[2] https://developers.google.com/search/docs/guides/intro-structured-data

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions