Skip to content

Commit 38e0d59

Browse files
committed
Set default for expandAllScripts to true for flatten and toRdf.
1 parent 21d639f commit 38e0d59

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/jsonld.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ jsonld.flatten = async function(input, ctx, options) {
387387
// set default options
388388
options = _setDefaults(options, {
389389
base: _isString(input) ? input : '',
390+
extractAllScripts: true,
390391
contextResolver: new ContextResolver(
391392
{sharedCache: _resolvedContextCache})
392393
});
@@ -656,6 +657,7 @@ jsonld.toRDF = async function(input, options) {
656657
// set default options
657658
options = _setDefaults(options, {
658659
base: _isString(input) ? input : '',
660+
extractAllScripts: true,
659661
skipExpansion: false,
660662
contextResolver: new ContextResolver(
661663
{sharedCache: _resolvedContextCache})
@@ -924,7 +926,7 @@ jsonld.get = async function(url, options) {
924926
remoteDoc
925927
});
926928
}
927-
if(!options.extractAllScripts) {
929+
if(frag || !options.extractAllScripts) {
928930
remoteDoc.document = remoteDoc.document[0];
929931
}
930932
} else {

tests/test-common.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ const TEST_TYPES = {
136136
specVersion: ['json-ld-1.0'],
137137
// FIXME
138138
idRegex: [
139-
// html
140-
/html-manifest.jsonld#tf004$/,
141139
// included
142140
/flatten-manifest.jsonld#tin01$/,
143141
/flatten-manifest.jsonld#tin02$/,
@@ -285,6 +283,7 @@ const TEST_TYPES = {
285283
/toRdf-manifest.jsonld#twf05$/,
286284
// html
287285
/html-manifest.jsonld#tr010$/,
286+
/html-manifest.jsonld#tr010$/, // unescaped content
288287
// Invalid Statement
289288
/toRdf-manifest.jsonld#te075$/,
290289
/toRdf-manifest.jsonld#te111$/,

0 commit comments

Comments
 (0)