Skip to content

Commit fda54af

Browse files
committed
Set default for expandAllScripts to true for flatten and toRdf.
1 parent 9a112d4 commit fda54af

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
@@ -77,8 +77,6 @@ const TEST_TYPES = {
7777
// NOTE: idRegex format:
7878
//MMM-manifest.jsonld#tNNN$/,
7979
idRegex: [
80-
// html
81-
/html-manifest.jsonld#tf004$/,
8280
]
8381
},
8482
fn: 'flatten',
@@ -150,6 +148,7 @@ const TEST_TYPES = {
150148
/toRdf-manifest.jsonld#twf05$/,
151149
// html
152150
/html-manifest.jsonld#tr010$/,
151+
/html-manifest.jsonld#tr010$/, // unescaped content
153152
// Invalid Statement
154153
/toRdf-manifest.jsonld#te075$/,
155154
/toRdf-manifest.jsonld#te111$/,

0 commit comments

Comments
 (0)