feat: Allow Google Embeds from regular (non publish-to-web) links (#1533)
Improve styling to allow getting back to source document
This commit is contained in:
@@ -2,9 +2,7 @@
|
||||
import * as React from "react";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const URL_REGEX = new RegExp(
|
||||
"^https?://docs.google.com/document/d/(.*)/pub(.*)$"
|
||||
);
|
||||
const URL_REGEX = new RegExp("^https?://docs.google.com/document/(.*)$");
|
||||
|
||||
type Props = {|
|
||||
attrs: {|
|
||||
@@ -18,7 +16,20 @@ export default class GoogleDocs extends React.Component<Props> {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Frame src={this.props.attrs.href} title="Google Docs Embed" border />
|
||||
<Frame
|
||||
src={this.props.attrs.href.replace("/edit", "/preview")}
|
||||
icon={
|
||||
<img
|
||||
src="/images/google-docs.png"
|
||||
alt="Google Docs Icon"
|
||||
width={16}
|
||||
height={16}
|
||||
/>
|
||||
}
|
||||
canonicalUrl={this.props.attrs.href}
|
||||
title="Google Docs"
|
||||
border
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user