From 06fed1df88a93571c5956b9a6f0b0d02e4093bbc Mon Sep 17 00:00:00 2001 From: Marielle Volz Date: Fri, 11 Aug 2023 10:16:07 +0100 Subject: [PATCH] EM: Fix bug where Facebook profiles get added to author field (#3103) Fix bug where authors from open graph metadata fields only got added if they contained a Facebook link (as opposed to the intended result which is to skip the field if it did). --- Embedded Metadata.js | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/Embedded Metadata.js b/Embedded Metadata.js index 5b7f264aac..4fc7e7432c 100644 --- a/Embedded Metadata.js +++ b/Embedded Metadata.js @@ -9,7 +9,7 @@ "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", - "lastUpdated": "2023-04-24 14:42:56" + "lastUpdated": "2023-08-11 09:54:50" } /* @@ -736,7 +736,7 @@ function tryOgAuthors(doc) { var authors = []; var ogAuthors = ZU.xpath(doc, '//meta[@property="article:author" or @property="video:director" or @property="music:musician"]'); for (var i = 0; i < ogAuthors.length; i++) { - if (ogAuthors[i].content && /(https?:\/\/)?[\da-z.-]+\.[a-z.]{2,6}/.test(ogAuthors[i].content) && ogAuthors[i].content !== "false") { + if (ogAuthors[i].content && !/(https?:\/\/)?[\da-z.-]+\.[a-z.]{2,6}/.test(ogAuthors[i].content) && ogAuthors[i].content !== "false") { authors.push(ZU.cleanAuthor(ogAuthors[i].content, "author")); } } @@ -2008,6 +2008,31 @@ var testCases = [ "seeAlso": [] } ] + }, + { + "type": "web", + "url": "https://www.nhs.uk/conditions/baby/babys-development/behaviour/separation-anxiety/", + "items": [ + { + "itemType": "webpage", + "title": "Separation anxiety", + "creators": [], + "date": "7 Dec 2020, 4:40 p.m.", + "abstractNote": "Separation anxiety is a normal part of your child's development. Find out how to handle the times when your baby or toddler cries or is clingy when you leave them.", + "language": "en", + "url": "https://www.nhs.uk/conditions/baby/babys-development/behaviour/separation-anxiety/", + "websiteTitle": "nhs.uk", + "attachments": [ + { + "title": "Snapshot", + "mimeType": "text/html" + } + ], + "tags": [], + "notes": [], + "seeAlso": [] + } + ] } ] /** END TEST CASES **/