From d7a913f183cfe35efe7f42bb2d46990abc07296d Mon Sep 17 00:00:00 2001 From: Graham Hudgins Date: Thu, 14 Nov 2024 08:30:10 -0500 Subject: [PATCH 1/7] [Discover] mailto links in data view urls (#200070) Adds `mailto:` as an allowed URL Url formatters in data views. --- src/plugins/field_formats/common/converters/url.test.ts | 8 ++++++++ src/plugins/field_formats/common/converters/url.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/field_formats/common/converters/url.test.ts b/src/plugins/field_formats/common/converters/url.test.ts index 7e465829e1eb1..d1c89575b2d4d 100644 --- a/src/plugins/field_formats/common/converters/url.test.ts +++ b/src/plugins/field_formats/common/converters/url.test.ts @@ -19,6 +19,14 @@ describe('UrlFormat', () => { ); }); + test('outputs a mailto: link when URL starts with mailto:', () => { + const url = new UrlFormat({}); + + expect(url.convert('mailto:test@example.com', HTML_CONTEXT_TYPE)).toBe( + 'mailto:test@example.com' + ); + }); + test('outputs an