fix: Add support for Airtable share links with app ID

This commit is contained in:
Tom Moor
2023-08-16 22:20:55 +02:00
parent 5f00b4f744
commit 4788ab3bd6
2 changed files with 11 additions and 1 deletions

View File

@@ -5,6 +5,14 @@ describe("Airtable", () => {
test("to be enabled on share link", () => {
expect("https://airtable.com/shrEoQs3erLnppMie".match(match)).toBeTruthy();
expect(
"https://airtable.com/shrEoQs3erLnppMie/tbl232i54yebXpr1J".match(match)
).toBeTruthy();
expect(
"https://airtable.com/app0lrLlMprqMbz11/shrEoQs3erLnppMie/tbl232i54yebXpr1J".match(
match
)
).toBeTruthy();
});
test("to be enabled on embed link", () => {

View File

@@ -2,7 +2,9 @@ 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/(?:app.*/)?(?:embed/)?(shr.*)$"
);
function Airtable(props: Props) {
const { matches } = props.attrs;