updated medium embeds to link out to new tab
This commit is contained in:
parent
34681a3f4f
commit
9f54400f18
|
|
@ -61,9 +61,9 @@ const transformUrl = (url: string): string => {
|
|||
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")) {
|
||||
return url.replace(/\/?$/, "?format=lite")
|
||||
return "about:blank"
|
||||
}
|
||||
|
||||
// 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 (
|
||||
<div style={wrapperStyle}>
|
||||
<div style={contentStyle}>
|
||||
|
|
|
|||
Loading…
Reference in New Issue