diff --git a/index.html b/index.html index 06d2e214..94cafb46 100644 --- a/index.html +++ b/index.html @@ -8577,10 +8577,11 @@
HTML script elements can be used to embed blocks of data in documents.
- This way, JSON-LD content can be easily embedded in HTML [[HTML52]] by placing
- it in a script element with the type
attribute set to
- application/ld+json
.
+ JSON-LD content can be easily embedded in HTML [[HTML52]] by placing
+ it in a Script element with the type
attribute set to
+ application/ld+json
. Doing so creates a
+ data block.
Otherwise, unless a specific script is targeted
- (see ),
- only the first script element of type
application/ld+json
is used.
When processing a JSON-LD - script element, - the Document Base URL - of the containing HTML document, - as defined in [[HTML52]], - is used to establish the default base IRI of the enclosed - JSON-LD content.
- -- The use of the Document Base URL - from [[HTML52]] for setting the base IRI of the enclosed JSON-LD - is an experimental feature, which may be changed in a future version of this specification. -
- - - -HTML allows for Dynamic changes to base URLs. - This specification does not require any specific behavior, - and to ensure that all systems process the base IRI equivalently, authors SHOULD - either use absolute IRIs, or explicitly as defined in . - Implementations (particularly those natively operating in the [[!DOM]]) MAY take into consideration - Dynamic changes to base URLs.
- -script
elementsAs HTML entities and comments are not allowable in - JSON, the use of comments, escapes, - and HTML Character references - is subject to further discussion in the Working Group.
- -Depending on how the HTML document is served, certain strings may need
- to be escaped. In particular, the content MAY be enclosed
- in the HTML comment-open (<!--
) and comment-close (-->
) text sequences.
As described in HTML Restrictions for contents of <script>
elements
- the textContent of a script element may include balanced comments
- and other text which complicate extracting the JSON-LD content from a data blocks.
- JSON-LD places further restrictions on the contents of
- script elements containing JSON-LD.
A JSON-LD script element MAY begin with an optional comment-open surrounded by any amount of space characters,
- followed by valid JSON and ending with an optional comment-close surrounded by any amount of space characters.
- Any content within the JSON content which can be confused with a comment-open, script-open,
- comment-close, or script-close MUST be escaped using a REVERSE SOLIDUS (\
) character
- as follows:
<!--
→ <\!--
<script
→ <\script
-->
→ --\>
</script
→ <\/script
Additionally, content of a script element MAY be escaped using HTML Character references, such as the following:
-&
→ & (ampersand, U+0026)<
→ < (less-than sign, U+003C)>
→ > (greater-than sign, U+003E)"
→ " (quotation mark, U+0022)'
→ ' (apostrophe, U+0027)JSON-LD Processors MUST remove surrounding comment-open and comment-close - sequences, unescape any escaped comment-open, comment-close, - script-open, and script-close sequences, - and turn HTML Character references into the corresponding Unicode. -
+base
elementWhen processing a JSON-LD + script element, + the Document Base URL + of the containing HTML document, + as defined in [[HTML52]], + is used to establish the default base IRI of the enclosed + JSON-LD content.
+ ++ The use of the Document Base URL + from [[HTML52]] for setting the base IRI of the enclosed JSON-LD + is an experimental feature, which may be changed in a future version of this specification. +