From 1aa4b48d4b87e40fb99fc59f3893d620f36afe91 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Thu, 5 Sep 2024 14:37:22 +0800 Subject: [PATCH] feat: add callback support for test parameter. --- src/index.ts | 10 +++++++--- test/index.test.ts | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 33de8d4..691ff6d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,7 @@ export type RehypeVideoOptions = { * URL suffix verification. * @default /\/(.*)(.mp4|.mov)$/ */ - test?: RegExp; + test?: RegExp | ((url: string) => boolean); /** * Support `
` tag to wrap