Skip to content

Commit fa1ffd8

Browse files
committed
Set default for expandAllScripts to true for flatten and toRdf.
1 parent d281254 commit fa1ffd8

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
@@ -379,6 +379,7 @@ jsonld.flatten = async function(input, ctx, options) {
379379
// set default options
380380
options = _setDefaults(options, {
381381
base: _isString(input) ? input : '',
382+
extractAllScripts: true,
382383
contextResolver: new ContextResolver(
383384
{sharedCache: _resolvedContextCache})
384385
});
@@ -664,6 +665,7 @@ jsonld.toRDF = async function(input, options) {
664665
// set default options
665666
options = _setDefaults(options, {
666667
base: _isString(input) ? input : '',
668+
extractAllScripts: true,
667669
skipExpansion: false,
668670
contextResolver: new ContextResolver(
669671
{sharedCache: _resolvedContextCache})
@@ -932,7 +934,7 @@ jsonld.get = async function(url, options) {
932934
remoteDoc
933935
});
934936
}
935-
if(!options.extractAllScripts) {
937+
if(frag || !options.extractAllScripts) {
936938
remoteDoc.document = remoteDoc.document[0];
937939
}
938940
} 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',
@@ -148,6 +146,7 @@ const TEST_TYPES = {
148146
/toRdf-manifest.jsonld#twf05$/,
149147
// html
150148
/html-manifest.jsonld#tr010$/,
149+
/html-manifest.jsonld#tr010$/, // unescaped content
151150
// Invalid Statement
152151
/toRdf-manifest.jsonld#te075$/,
153152
/toRdf-manifest.jsonld#te111$/,

0 commit comments

Comments
 (0)