Use test instead of match

This commit is contained in:
Matt Bierner 2022-02-08 16:58:28 -08:00
parent c5ddf8bc5a
commit 621a354706
No known key found for this signature in database
GPG key ID: 099C331567E11888

View file

@ -138,9 +138,9 @@ export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRende
href = removeMarkdownEscapes(href);
if (
!href
|| href.match(/^data:|javascript:/i)
|| (href.match(/^command:/i) && !markdown.isTrusted)
|| href.match(/^command:(\/\/\/)?_workbench\.downloadResource/i)
|| /^data:|javascript:/i.test(href)
|| (/^command:/i.test(href) && !markdown.isTrusted)
|| /^command:(\/\/\/)?_workbench\.downloadResource/i.test(href)
) {
// drop the link
return text;