diff options
Diffstat (limited to 'src/webview')
-rw-r--r-- | src/webview/lib/RecipeWebview.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/webview/lib/RecipeWebview.ts b/src/webview/lib/RecipeWebview.ts index e7a39579b..3afb93acb 100644 --- a/src/webview/lib/RecipeWebview.ts +++ b/src/webview/lib/RecipeWebview.ts | |||
@@ -93,6 +93,15 @@ class RecipeWebview { | |||
93 | } | 93 | } |
94 | 94 | ||
95 | /** | 95 | /** |
96 | * Find if url contains image | ||
97 | * | ||
98 | * @param {string | number | undefined | null} text to be parsed | ||
99 | */ | ||
100 | isImage(url): boolean { | ||
101 | return /\.(jpg|jpeg|png|webp|avif|gif|svg)$/.test(url); | ||
102 | } | ||
103 | |||
104 | /** | ||
96 | * Injects the contents of a CSS file into the current webview | 105 | * Injects the contents of a CSS file into the current webview |
97 | * | 106 | * |
98 | * @param {Array} files CSS files that should be injected. This must | 107 | * @param {Array} files CSS files that should be injected. This must |