Improve reliability of embed regex (missing start char)
This commit is contained in:
@@ -15,8 +15,8 @@ function Abstract(props: Props) {
|
||||
}
|
||||
|
||||
Abstract.ENABLED = [
|
||||
new RegExp("https?://share\\.(?:go)?abstract\\.com/(.*)$"),
|
||||
new RegExp("https?://app\\.(?:go)?abstract\\.com/(?:share|embed)/(.*)$"),
|
||||
new RegExp("^https?://share\\.(?:go)?abstract\\.com/(.*)$"),
|
||||
new RegExp("^https?://app\\.(?:go)?abstract\\.com/(?:share|embed)/(.*)$"),
|
||||
];
|
||||
|
||||
export default Abstract;
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as React from "react";
|
||||
import Frame from "../components/Frame";
|
||||
import { EmbedProps as Props } from ".";
|
||||
|
||||
const URL_REGEX = new RegExp("https://airtable.com/(?:embed/)?(shr.*)$");
|
||||
const URL_REGEX = new RegExp("^https://airtable.com/(?:embed/)?(shr.*)$");
|
||||
|
||||
function Airtable(props: Props) {
|
||||
const { matches } = props.attrs;
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as React from "react";
|
||||
import Frame from "../components/Frame";
|
||||
import { EmbedProps as Props } from ".";
|
||||
|
||||
const URL_REGEX = new RegExp("https?://cawemo.com/(?:share|embed)/(.*)$");
|
||||
const URL_REGEX = new RegExp("^https?://cawemo.com/(?:share|embed)/(.*)$");
|
||||
|
||||
export default function Cawemo(props: Props) {
|
||||
const { matches } = props.attrs;
|
||||
|
||||
@@ -17,4 +17,4 @@ export default function DBDiagram(props: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
DBDiagram.ENABLED = [new RegExp("https://dbdiagram.io/(embed|d)/(\\w+)$")];
|
||||
DBDiagram.ENABLED = [new RegExp("^https://dbdiagram.io/(embed|d)/(\\w+)$")];
|
||||
|
||||
@@ -15,4 +15,6 @@ export default function Descript(props: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
Descript.ENABLED = [new RegExp("https?://share\\.descript\\.com/view/(\\w+)$")];
|
||||
Descript.ENABLED = [
|
||||
new RegExp("^https?://share\\.descript\\.com/view/(\\w+)$"),
|
||||
];
|
||||
|
||||
@@ -15,7 +15,7 @@ function Figma(props: Props) {
|
||||
|
||||
Figma.ENABLED = [
|
||||
new RegExp(
|
||||
"https://([w.-]+\\.)?figma\\.com/(file|proto)/([0-9a-zA-Z]{22,128})(?:/.*)?$"
|
||||
"^https://([w.-]+\\.)?figma\\.com/(file|proto)/([0-9a-zA-Z]{22,128})(?:/.*)?$"
|
||||
),
|
||||
];
|
||||
|
||||
|
||||
@@ -20,6 +20,6 @@ function JSFiddle(props: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
JSFiddle.ENABLED = [new RegExp("https?://jsfiddle\\.net/(.*)/(.*)$")];
|
||||
JSFiddle.ENABLED = [new RegExp("^https?://jsfiddle\\.net/(.*)/(.*)$")];
|
||||
|
||||
export default JSFiddle;
|
||||
|
||||
@@ -14,6 +14,6 @@ function Otter(props: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
Otter.ENABLED = [new RegExp("https?://otter\\.ai/[su]/(.*)$")];
|
||||
Otter.ENABLED = [new RegExp("^https?://otter\\.ai/[su]/(.*)$")];
|
||||
|
||||
export default Otter;
|
||||
|
||||
@@ -39,6 +39,6 @@ const SpotifyFrame = styled(Frame)`
|
||||
border-radius: 13px;
|
||||
`;
|
||||
|
||||
Spotify.ENABLED = [new RegExp("https?://open\\.spotify\\.com/(.*)$")];
|
||||
Spotify.ENABLED = [new RegExp("^https?://open\\.spotify\\.com/(.*)$")];
|
||||
|
||||
export default Spotify;
|
||||
|
||||
@@ -14,6 +14,6 @@ function Tldraw(props: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
Tldraw.ENABLED = [new RegExp("https?://beta\\.tldraw\\.com/r/(.*)")];
|
||||
Tldraw.ENABLED = [new RegExp("^https?://beta\\.tldraw\\.com/r/(.*)")];
|
||||
|
||||
export default Tldraw;
|
||||
|
||||
Reference in New Issue
Block a user