updated medium embeds to link out to new tab
This commit is contained in:
parent
7a1093b12a
commit
647d89a70c
|
|
@ -61,9 +61,9 @@ const transformUrl = (url: string): string => {
|
||||||
return `https://platform.x.com/embed/Tweet.html?id=${tweetMatch[1]}`
|
return `https://platform.x.com/embed/Tweet.html?id=${tweetMatch[1]}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Medium
|
// Medium - return about:blank to prevent iframe loading
|
||||||
if (url.includes("medium.com")) {
|
if (url.includes("medium.com")) {
|
||||||
return url.replace(/\/?$/, "?format=lite")
|
return "about:blank"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gather.town
|
// Gather.town
|
||||||
|
|
@ -180,6 +180,40 @@ export class EmbedShape extends BaseBoxShapeUtil<IEmbedShape> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shape.props.url?.includes("medium.com")) {
|
||||||
|
return (
|
||||||
|
<div style={wrapperStyle}>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
...contentStyle,
|
||||||
|
flexDirection: "column",
|
||||||
|
gap: "12px",
|
||||||
|
padding: "20px",
|
||||||
|
textAlign: "center",
|
||||||
|
pointerEvents: "all",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
Medium's content policy does not allow for embedding articles in
|
||||||
|
iframes.
|
||||||
|
</p>
|
||||||
|
<a
|
||||||
|
href={shape.props.url}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
style={{
|
||||||
|
color: "#1976d2",
|
||||||
|
textDecoration: "none",
|
||||||
|
cursor: "pointer",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Open article in new tab →
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={wrapperStyle}>
|
<div style={wrapperStyle}>
|
||||||
<div style={contentStyle}>
|
<div style={contentStyle}>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue