import * as React from "react"; import styled from "styled-components"; import { EmbedProps as Props } from "."; const URL_REGEX = new RegExp( "^https://gist\\.github\\.com/([a-zA-Z\\d](?:[a-zA-Z\\d]|-(?=[a-zA-Z\\d])){0,38})/(.*)$" ); class Gist extends React.Component { static ENABLED = [URL_REGEX]; get id() { const gistUrl = new URL(this.props.attrs.href); return gistUrl.pathname.split("/")[2]; } render() { const id = this.id; const gistLink = `https://gist.github.com/${id}.js`; const gistScript = ``; const styles = ""; const iframeHtml = `${styles}${gistScript}`; return (