From b2ecdf5224429793c011843e3557d17e08f27576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 10 Dec 2020 14:09:03 +0100 Subject: [PATCH] MOBILE-3608 core: Handle content links --- src/core/directives/link.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/directives/link.ts b/src/core/directives/link.ts index 35d491e9b..40efb60b9 100644 --- a/src/core/directives/link.ts +++ b/src/core/directives/link.ts @@ -22,6 +22,7 @@ import { CoreUrlUtils } from '@services/utils/url'; import { CoreUtils } from '@services/utils/utils'; import { CoreTextUtils } from '@services/utils/text'; import { CoreConstants } from '@/core/constants'; +import { CoreContentLinksHelper } from '@features/contentlinks/services/contentlinks-helper'; /** * Directive to open a link in external browser or in the app. @@ -76,8 +77,10 @@ export class CoreLinkDirective implements OnInit { if (CoreUtils.instance.isTrueOrOne(this.capture)) { href = CoreTextUtils.instance.decodeURI(href); - // @todo: Handle link. - this.navigate(href, openIn); + const treated = CoreContentLinksHelper.instance.handleLink(href, undefined, true, true); + if (!treated) { + this.navigate(href, openIn); + } } else { this.navigate(href, openIn); }