fix: Bad functional refactor

This commit is contained in:
Tom Moor
2022-10-10 07:47:35 -04:00
parent 73b604cd9d
commit 2f2e367e91

View File

@@ -6,7 +6,7 @@ const URL_REGEX = new RegExp("^https://codepen.io/(.*?)/(pen|embed)/(.*)$");
export default function Codepen(props: Props) { export default function Codepen(props: Props) {
const normalizedUrl = props.attrs.href.replace(/\/pen\//, "/embed/"); const normalizedUrl = props.attrs.href.replace(/\/pen\//, "/embed/");
return <Frame {...this.props} src={normalizedUrl} title="Codepen Embed" />; return <Frame {...props} src={normalizedUrl} title="Codepen Embed" />;
} }
Codepen.ENABLED = [URL_REGEX]; Codepen.ENABLED = [URL_REGEX];