Support Figma embeds

This commit is contained in:
Austin Chen 2022-08-26 12:41:39 -07:00
parent ba7d0f45db
commit 3255806891

View File

@ -40,6 +40,11 @@ const embedPatterns: EmbedPattern[] = [
rewrite: (id) =>
`<iframe src="https://www.metaculus.com/questions/embed/${id}"></iframe>`,
},
{
regex: /^(https?:\/\/www\.figma\.com\/(?:file|proto)\/[^\/]+\/[^\/]+)/,
rewrite: (url) =>
`<iframe src="https://www.figma.com/embed?embed_host=manifold&url=${url}"></iframe>`,
},
// Twitch is a bit annoying, since it requires the `&parent=DOMAIN` to match
{
// Twitch: https://www.twitch.tv/videos/1445087149