Skip to content

Commit 212313d

Browse files
authored
fix: Change children prop to innerHTML
Resolves #1466 (#1467)
1 parent 95c40bc commit 212313d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

packages/nuxt-jsonld/src/runtime/composable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const useJsonld = (json: JsonLD | JsonLDFunc, options?: UseJsonldOptions)
1919
script: [
2020
{
2121
type: 'application/ld+json',
22-
children: JSON.stringify(jsonComputed.value, null, ''),
22+
innerHTML: JSON.stringify(jsonComputed.value, null, ''),
2323
},
2424
],
2525
};

packages/nuxt-jsonld/src/runtime/plugin-impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const vuePlugin: Plugin = {
1313
script: [
1414
{
1515
type: 'application/ld+json',
16-
children: jsonComputed.value
16+
innerHTML: jsonComputed.value
1717
? JSON.stringify(jsonComputed.value, null, '')
1818
: undefined,
1919
},

packages/nuxt-jsonld/test/composable.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('useJsonld', () => {
2929
script: [
3030
{
3131
type: 'application/ld+json',
32-
children: '{"@context":"https://schema.org","@type":"Thing","name":"foo"}',
32+
innerHTML: '{"@context":"https://schema.org","@type":"Thing","name":"foo"}',
3333
},
3434
],
3535
});
@@ -48,7 +48,7 @@ describe('useJsonld', () => {
4848
script: [
4949
{
5050
type: 'application/ld+json',
51-
children: '{"@context":"https://schema.org","@type":"Thing","name":"foo"}',
51+
innerHTML: '{"@context":"https://schema.org","@type":"Thing","name":"foo"}',
5252
},
5353
],
5454
});

packages/nuxt-jsonld/test/plugin-impl.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('plugin-impl', () => {
6464
script: [
6565
{
6666
type: 'application/ld+json',
67-
children: '{"@context":"https://schema.org","@type":"Thing","name":0}',
67+
innerHTML: '{"@context":"https://schema.org","@type":"Thing","name":0}',
6868
},
6969
],
7070
});
@@ -90,7 +90,7 @@ describe('plugin-impl', () => {
9090
script: [
9191
{
9292
type: 'application/ld+json',
93-
children: undefined,
93+
innerHTML: undefined,
9494
},
9595
],
9696
});

0 commit comments

Comments
 (0)