Skip to content

Commit bd77ed9

Browse files
committed
match media with url params by default
1 parent 078f4ff commit bd77ed9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/curly-banks-move.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@bluecadet/launchpad-content": patch
3+
---
4+
5+
media downloader: match images with url params by default

docs/src/reference/content/plugins/media-downloader.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Specifies which data keys to search for media URLs. If not provided, all keys wi
3434
### `mediaPattern`
3535

3636
- **Type:** `RegExp`
37-
- **Default:** `/https?.*\.(jpe?g|png|webp|avi|mov|mp4|mpg|mpeg|webm)$/i`
37+
- **Default:** `/https?.*\.(jpe?g|png|webp|avi|mov|mp4|mpg|mpeg|webm)(\?.*)$/i`
3838

3939
Regex pattern to match URLs for downloading.
4040

packages/content/src/plugins/media-downloader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import ResultAsyncQueue from "../utils/result-async-queue.js";
1212
import { safeKy } from "../utils/safe-ky.js";
1313
import { CacheProgressLogger, parsePluginConfig, queryOrUpdate } from "./contentPluginHelpers.js";
1414

15-
const DEFAULT_MEDIA_PATTERN = /https?.*\.(jpe?g|png|webp|avi|mov|mp4|mpg|mpeg|webm)$/i;
15+
const DEFAULT_MEDIA_PATTERN = /https?.*\.(jpe?g|png|webp|avi|mov|mp4|mpg|mpeg|webm)(\?.*)?$/i;
1616

1717
declare module "../content-plugin-driver.js" {
1818
interface ContentHookArgs {

0 commit comments

Comments
 (0)