Skip to content

Commit c74d909

Browse files
committed
Set default for expandAllScripts to true for flatten and toRdf.
1 parent 2956ea6 commit c74d909

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
@@ -74,8 +74,6 @@ const TEST_TYPES = {
7474
specVersion: ['json-ld-1.0'],
7575
// FIXME
7676
idRegex: [
77-
// html
78-
/html-manifest.jsonld#tf004$/,
7977
]
8078
},
8179
fn: 'flatten',
@@ -210,6 +208,7 @@ const TEST_TYPES = {
210208
/toRdf-manifest.jsonld#twf05$/,
211209
// html
212210
/html-manifest.jsonld#tr010$/,
211+
/html-manifest.jsonld#tr010$/, // unescaped content
213212
// Invalid Statement
214213
/toRdf-manifest.jsonld#te075$/,
215214
/toRdf-manifest.jsonld#te111$/,

0 commit comments

Comments
 (0)