Skip to content

Commit cacd62b

Browse files
committed
Set default for expandAllScripts to true for flatten and toRdf.
1 parent 4aefc72 commit cacd62b

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
@@ -124,8 +124,6 @@ const TEST_TYPES = {
124124
specVersion: ['json-ld-1.0'],
125125
// FIXME
126126
idRegex: [
127-
// html
128-
/html-manifest.jsonld#tf004$/,
129127
// included
130128
/flatten-manifest.jsonld#tin01$/,
131129
/flatten-manifest.jsonld#tin02$/,
@@ -273,6 +271,7 @@ const TEST_TYPES = {
273271
/toRdf-manifest.jsonld#twf05$/,
274272
// html
275273
/html-manifest.jsonld#tr010$/,
274+
/html-manifest.jsonld#tr010$/, // unescaped content
276275
// Invalid Statement
277276
/toRdf-manifest.jsonld#te075$/,
278277
/toRdf-manifest.jsonld#te111$/,

0 commit comments

Comments
 (0)