Skip to content

Remove two-paragraph placement constraint for affiliate disclaimer - #29041

Open
ecguardian wants to merge 1 commit into
mainfrom
remove-legacy-placement-constraint-affiliate-disclaimer
Open

Remove two-paragraph placement constraint for affiliate disclaimer#29041
ecguardian wants to merge 1 commit into
mainfrom
remove-legacy-placement-constraint-affiliate-disclaimer

Conversation

@ecguardian

Copy link
Copy Markdown
Contributor

The affiliate disclaimer and links were previously gated on the article having at least two leading

elements with the second being 150+ chars. This was a layout constraint for older rendering that is no longer needed since DCR handles disclaimer placement independently.

Now shouldAddAffiliateLinks delegates directly to the tag/switch/field check for all content types, matching the existing gallery behaviour.

What does this change?

what was changed:

  1. Removed the two-paragraph constraint from shouldAddAffiliateLinks in DotcomRenderingUtils.scala:294-301. The method now delegates directly to AffiliateLinksCleaner.shouldAddAffiliateLinks for all content types (galleries and articles alike), without parsing HTML or checking paragraph structure.

  2. Removed the unused org.jsoup.Jsoup import since the HTML parsing logic was the only consumer.

Screenshots

Checklist

…imer

The affiliate disclaimer and links were previously gated on the article
having at least two leading <p> elements with the second being 150+ chars.
This was a layout constraint for older rendering that is no longer needed
since DCR handles disclaimer placement independently.

Now shouldAddAffiliateLinks delegates directly to the tag/switch/field
check for all content types, matching the existing gallery behaviour.
@ecguardian
ecguardian requested a review from a team as a code owner August 7, 2026 09:10
@ecguardian ecguardian added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@andrewHEguardian andrewHEguardian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely to remove that paragraph logic! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do not merge ⚠️ maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants