From ed0bf0ae60c2f1256621f106f4bc8f0250ed1812 Mon Sep 17 00:00:00 2001 From: Dusan Kosanovic Date: Wed, 19 Feb 2025 10:37:37 +0100 Subject: [PATCH 1/4] [MWPW-162639] youtube block a tag fix --- libs/utils/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/utils/utils.js b/libs/utils/utils.js index fba5117d5b..aae5c599ed 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -264,7 +264,7 @@ export const [setConfig, updateConfig, getConfig] = (() => { })(); export function isInTextNode(node) { - return node.parentElement.firstChild.nodeType === Node.TEXT_NODE; + return node.parentElement.firstChild.tagName === 'A' || node.parentElement.firstChild.nodeType === Node.TEXT_NODE; } export function createTag(tag, attributes, html, options = {}) { From c9cbaf0d0e78bb62cf0ba78a8b3687ea2fdad90f Mon Sep 17 00:00:00 2001 From: Dusan Kosanovic Date: Wed, 19 Feb 2025 14:04:08 +0100 Subject: [PATCH 2/4] [MWPW-162639] condition update --- libs/utils/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/utils/utils.js b/libs/utils/utils.js index aae5c599ed..03e26c21ec 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -264,7 +264,7 @@ export const [setConfig, updateConfig, getConfig] = (() => { })(); export function isInTextNode(node) { - return node.parentElement.firstChild.tagName === 'A' || node.parentElement.firstChild.nodeType === Node.TEXT_NODE; + return (node.parentElement.children.length > 1 && node.parentElement.firstChild.tagName === 'A') || node.parentElement.firstChild.nodeType === Node.TEXT_NODE; } export function createTag(tag, attributes, html, options = {}) { From 77ce08792bb4a9d48e224d3064bc6b1dd5e930fd Mon Sep 17 00:00:00 2001 From: Dusan Kosanovic Date: Thu, 20 Feb 2025 12:11:21 +0100 Subject: [PATCH 3/4] [MWPW-162639] clause fix --- libs/utils/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/utils/utils.js b/libs/utils/utils.js index 03e26c21ec..7f9c6c0f4a 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -264,7 +264,9 @@ export const [setConfig, updateConfig, getConfig] = (() => { })(); export function isInTextNode(node) { - return (node.parentElement.children.length > 1 && node.parentElement.firstChild.tagName === 'A') || node.parentElement.firstChild.nodeType === Node.TEXT_NODE; + console.log('node.parentElement.children.length', node.parentElement.children.length); + + return (node.parentElement.childNodes.length > 1 && node.parentElement.firstChild.tagName === 'A') || node.parentElement.firstChild.nodeType === Node.TEXT_NODE; } export function createTag(tag, attributes, html, options = {}) { From 2fe450f145cdfc2239e5b7eaf574d141a2eb0303 Mon Sep 17 00:00:00 2001 From: Dusan Kosanovic Date: Thu, 20 Feb 2025 12:12:23 +0100 Subject: [PATCH 4/4] [MWPW-162639] code removal --- libs/utils/utils.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/libs/utils/utils.js b/libs/utils/utils.js index 7f9c6c0f4a..14db643d48 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -264,8 +264,6 @@ export const [setConfig, updateConfig, getConfig] = (() => { })(); export function isInTextNode(node) { - console.log('node.parentElement.children.length', node.parentElement.children.length); - return (node.parentElement.childNodes.length > 1 && node.parentElement.firstChild.tagName === 'A') || node.parentElement.firstChild.nodeType === Node.TEXT_NODE; }