From 740348ca5831b06ba9e8fc3b30256a2aeac01c64 Mon Sep 17 00:00:00 2001 From: Robert Bogos <146744221+robert-bogos@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:59:14 +0300 Subject: [PATCH] [MWPW-158756] Enhance stage links conversion for cross-domain localization (#2913) * support cross-domain localization on stage links conversion * Update libs/utils/utils.js Co-authored-by: Rares Munteanu * hotfix --------- Co-authored-by: Rares Munteanu --- libs/utils/utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/utils/utils.js b/libs/utils/utils.js index 07fee41492..7f1a434d83 100644 --- a/libs/utils/utils.js +++ b/libs/utils/utils.js @@ -659,8 +659,7 @@ export function decorateLinks(el) { decorateImageLinks(el); const anchors = el.getElementsByTagName('a'); const { hostname } = window.location; - convertStageLinks({ anchors, config, hostname }); - return [...anchors].reduce((rdx, a) => { + const links = [...anchors].reduce((rdx, a) => { appendHtmlToLink(a); a.href = localizeLink(a.href); decorateSVG(a); @@ -695,6 +694,8 @@ export function decorateLinks(el) { } return rdx; }, []); + convertStageLinks({ anchors, config, hostname }); + return links; } function decorateContent(el) {