Skip to content

Commit

Permalink
Merge pull request #447 from GBishop-PHSA/feature/gh-446
Browse files Browse the repository at this point in the history
gh-446 Update HTML parser for mailto links
  • Loading branch information
jamesrwelch authored Jan 27, 2022
2 parents 429a29f + b4447ef commit 4be652b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ describe('LinkCreatorService', () => {
it('render urls as HTML', () => {
expect(service.createLink('http://localhost', '', 'link')).toEqual('http://localhost');
});

it('render emails as HTML', () => {
expect(service.createLink('mailto:user@test.com', '', 'email')).toEqual('mailto:user@test.com');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class LinkCreatorService {
return this.elementTypes.getLinkUrl(mcElement);
}

if (elementType === 'http') {
if (elementType === 'http' || elementType ==='mailto') {
return href;
}
}
Expand Down

0 comments on commit 4be652b

Please sign in to comment.