diff --git a/packages/link/test/link.test.ts b/packages/link/test/link.test.ts index 6dcdaaa732..f9a0ab26b9 100644 --- a/packages/link/test/link.test.ts +++ b/packages/link/test/link.test.ts @@ -46,4 +46,20 @@ describe('Link', () => { await expect(el).to.be.accessible(); }); + + it('loads[rel]', async () => { + const el = await fixture( + html` + + Default Link + + ` + ); + + await elementUpdated(el); + expect(el).to.not.be.undefined; + expect(el.getAttribute('rel')).to.eq('external')); + + await expect(el).to.be.accessible(); + }); }); diff --git a/packages/shared/src/like-anchor.ts b/packages/shared/src/like-anchor.ts index 7fd7f2c889..5acbc89a29 100644 --- a/packages/shared/src/like-anchor.ts +++ b/packages/shared/src/like-anchor.ts @@ -22,6 +22,7 @@ export interface LikeAnchorInterface { download?: string; label?: string; href?: string; + rel?: string; target?: '_blank' | '_parent' | '_self' | '_top'; renderAnchor(options: { id: string; @@ -45,6 +46,9 @@ export function LikeAnchor>( @property({ reflect: true }) public target?: '_blank' | '_parent' | '_self' | '_top'; + @property({ reflect: true }) + public rel?: string; + public renderAnchor({ id, // prettier-ignore @@ -61,6 +65,7 @@ export function LikeAnchor>( download=${ifDefined(this.download)} target=${ifDefined(this.target)} aria-label=${ifDefined(this.label)} + rel=${ifDefined(this.rel)} >${anchorContent}`; } }