From 0f4e9feafad9b616cde7276c6db204608be31900 Mon Sep 17 00:00:00 2001 From: Gary Meehan Date: Sun, 12 Aug 2018 20:51:17 +0100 Subject: [PATCH] Allow Duplicate Open Graph Image Tags (#4851) * allow og:image duplicates * add tests * update tests * fix spacing --- lib/head.js | 2 +- test/integration/basic/pages/head.js | 14 ++++++++++++++ test/integration/basic/test/rendering.js | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/head.js b/lib/head.js index 5afbb8f6..d7b1423f 100644 --- a/lib/head.js +++ b/lib/head.js @@ -49,7 +49,7 @@ function onStateChange (head) { } const METATYPES = ['name', 'httpEquiv', 'charSet', 'itemProp', 'property'] -const ALLOWED_DUPLICATES = ['article:tag'] +const ALLOWED_DUPLICATES = ['article:tag', 'og:image', 'og:image:alt', 'og:image:width', 'og:image:height', 'og:image:type', 'og:image:secure_url', 'og:image:url'] /* returns a function for filtering head child elements diff --git a/test/integration/basic/pages/head.js b/test/integration/basic/pages/head.js index 05bc13e9..9e219a82 100644 --- a/test/integration/basic/pages/head.js +++ b/test/integration/basic/pages/head.js @@ -15,6 +15,20 @@ export default () =>
+ + + + + + + + + + + + + + Fragment title diff --git a/test/integration/basic/test/rendering.js b/test/integration/basic/test/rendering.js index 16f3ac15..3f375edc 100644 --- a/test/integration/basic/test/rendering.js +++ b/test/integration/basic/test/rendering.js @@ -49,6 +49,20 @@ export default function ({ app }, suiteName, render, fetch) { expect(html).toContain('') expect(html).not.toContain('') expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') + expect(html).toContain('') }) test('header helper renders Fragment children', async () => {