From 1577ae1962b68b2f699434e1a931b5785870823d Mon Sep 17 00:00:00 2001 From: Emma Imber Date: Tue, 14 May 2024 15:02:24 +0100 Subject: [PATCH] Add minimum character count for second p element --- common/app/model/dotcomrendering/DotcomRenderingUtils.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/app/model/dotcomrendering/DotcomRenderingUtils.scala b/common/app/model/dotcomrendering/DotcomRenderingUtils.scala index 7a895d5c1ce8..996ef732729f 100644 --- a/common/app/model/dotcomrendering/DotcomRenderingUtils.scala +++ b/common/app/model/dotcomrendering/DotcomRenderingUtils.scala @@ -248,7 +248,7 @@ object DotcomRenderingUtils { if (bodyElements.size >= 2) { val firstEl = bodyElements.get(0) val secondEl = bodyElements.get(1) - if (firstEl.tagName == "p" && secondEl.tagName == "p") { + if (firstEl.tagName == "p" && secondEl.tagName == "p" && secondEl.text().length >= 250) { AffiliateLinksCleaner.shouldAddAffiliateLinks( switchedOn = Switches.AffiliateLinks.isSwitchedOn, section = content.metadata.sectionId,