You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add section on restrictions for JSON-LD script elements, which is more restrictive than the base HTML definitions. This includes a sketch processing model for removing comments and unescaping the resulting content.
Copy file name to clipboardExpand all lines: index.html
+104Lines changed: 104 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8592,6 +8592,110 @@ <h3>Graph Containers</h3>
8592
8592
</aside>
8593
8593
</section>
8594
8594
8595
+
<section><h3>Restrictions for contents of JSON-LD <code>script</code> elements</h3>
8596
+
8597
+
<p>Depending on how the HTML document is served, certain strings may need
8598
+
to be escaped. In particular, the content MAY be enclosed
8599
+
in the HTML <em>comment-open</em> (<code><!--</code>) and <em>comment-close</em> (<code>--></code>) text sequences.</p>
8600
+
<p>As described in HTML <adata-cite="HTML52/semantics-scripting.html#restrictions-for-contents-of-script-elements">Restrictions for contents of <code><script></code> elements</a>
8601
+
the <adata-cite="DOM#dom-node-textcontent">textContent</a> of a script element may include balanced comments
8602
+
and other text which complicate extracting the JSON-LD content from a <adata-cite="HTML52/semantics-scripting.html#data-block">data blocks</a>.
8603
+
JSON-LD places further restrictions on the contents of
<p>Additionally, content of a script element MAY be escaped using <adata-cite="HTML5/syntax.html#character-references">HTML Character references</a>, such as the following:</p>
8617
+
<ul>
8618
+
<li><code>&amp;</code> → & (<ahref="/wiki/Ampersand" title="Ampersand">ampersand</a>, U+0026)</li>
>>>>>>> 87ab2ee... Add section on restrictions for JSON-LD script elements, which is more restrictive than the base HTML definitions. This includes a sketch processing model for removing comments and unescaping the resulting content.
8698
+
8595
8699
<section><h3>Locating a Specific JSON-LD Script Element</h3>
0 commit comments