Skip to content

Commit

Permalink
MWPW-154057 social share destination links has '#_blank' added at end…
Browse files Browse the repository at this point in the history
… of url for few locales (#2579)

Fixed the issue where social links were broken on some pages
  • Loading branch information
sharmrj authored Jul 22, 2024
1 parent 6943446 commit 8c5b0ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/blocks/global-footer/global-footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,15 @@ class Footer {

const socialElem = toFragment`<ul class="feds-social" daa-lh="Social"></ul>`;

const sanitizeLink = (link) => link.replace('#_blank', '').replace('#_dnb', '');

CONFIG.socialPlatforms.forEach((platform, index) => {
const link = socialBlock.querySelector(`a[href*="${platform}"]`);
if (!link) return;

const iconElem = toFragment`<li class="feds-social-item">
<a
href="${link.href}"
href="${sanitizeLink(link.href)}"
class="feds-social-link"
aria-label="${platform}"
daa-ll="${getAnalyticsValue(platform, index + 1)}"
Expand Down

0 comments on commit 8c5b0ac

Please sign in to comment.