Skip to content

Commit 04674fe

Browse files
Add #mixed-script-types test
1 parent cc78306 commit 04674fe

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

tests/cases/html/mixed-types.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<html>
2+
<head>
3+
<script type="application/ld+yaml">
4+
"@context": https://json-ld.org/contexts/person.jsonld
5+
"@id": https://dbpedia.org/resource/John_Lennon
6+
name: John Lennon
7+
born: 1940-10-09
8+
spouse:
9+
- https://dbpedia.org/resource/Yoko_Ono
10+
- https://dbpedia.org/resource/Cynthia_Lennon
11+
---
12+
"@context": https://json-ld.org/contexts/person.jsonld
13+
"@id": https://dbpedia.org/resource/Yoko_Ono
14+
born: 1933-02-18
15+
</script>
16+
</head>
17+
<body>
18+
<h1>Hi!</h1>
19+
20+
<script type="application/ld+json">
21+
{
22+
"@context": "https://json-ld.org/contexts/person.jsonld",
23+
"@id": "https://dbpedia.org/resource/Cynthia_Lennon",
24+
"born": "1939-09-10"
25+
}
26+
</script>
27+
</body>
28+
</html>

tests/manifest.jsonld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,15 @@
198198
"input": "cases/html/stream.html",
199199
"expect": "cases/html/stream.yamlld"
200200
},
201+
{
202+
"@id": "#mixed-script-types",
203+
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],
204+
"name": "YAML Stream with multiple documents embedded into HTML, having JSON-LD and YAML-LD documents in them.",
205+
"req": "must",
206+
"option": {"extractAllScripts": true},
207+
"input": "cases/html/mixed-types.html",
208+
"expect": "cases/html/stream.yamlld"
209+
},
201210
{
202211
"@id": "#html-dedent-needed",
203212
"@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"],

0 commit comments

Comments
 (0)