Skip to content

Commit 8f4b8e2

Browse files
steffenKristján Oddsson
andauthored
Define regular expression inline
Co-authored-by: Kristján Oddsson <[email protected]>
1 parent da17a94 commit 8f4b8e2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/paste-markdown-link.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ function linkify(selectedText: string, text: string): string {
4747
return selectedText.length && isURL(text) ? `[${selectedText}](${text})` : text
4848
}
4949

50-
const URL_RE = /^https?:\/\//i
51-
5250
function isURL(url: string): boolean {
53-
return URL_RE.test(url)
51+
return /^https?:\/\//i.test(url)
5452
}

0 commit comments

Comments
 (0)