1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-09 09:35:02 +09:00

github gist embed url

This commit is contained in:
Andrew Simachev 2024-01-18 18:26:31 +01:00
parent fe49c64521
commit 27b2e11219
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
4 changed files with 6 additions and 3 deletions

View file

@ -21,7 +21,9 @@
iframe { margin: 0px !important; display: inline-block !important; }
.twitter-tweet, .instagram-media { margin: 0px !important; display: inline-flex !important; }
.gist-file { margin: 0px !important; }
.gist-file { margin: 0px 0px 16px 0px !important; }
.gist-file:last-child { margin-bottom: 0px !important; }
.cp_embed_iframe { border: 0px !important; height: auto; aspect-ratio: 16/9; }
html.align1 .twitter-tweet, body.align1 .instagram-media { justify-content: center; }

View file

@ -69,7 +69,7 @@ const ViewCalendar = observer(class ViewCalendar extends React.Component<I.ViewC
<div className="side right">
<Icon className="arrow left" onClick={() => this.onArrow(-1)} />
<div className="btn" onClick={this.onToday}>{translate('menuCalendarToday')}</div>
<div className="btn" onClick={this.onToday}>{translate('commonToday')}</div>
<Icon className="arrow right" onClick={() => this.onArrow(1)} />
</div>
</div>

View file

@ -644,7 +644,7 @@ const BlockEmbed = observer(class BlockEmbed extends React.Component<I.BlockComp
};
if (block.isEmbedGithubGist()) {
allowScript = !!text.match(/src="https:\/\/gist.github.com([^"]+)"/);
allowScript = !!text.match(/(?:src=")?(https:\/\/gist.github.com(?:[^"]+))"?/);
};
if (block.isEmbedSketchfab() && text.match(/<(iframe|script)/)) {

View file

@ -12,6 +12,7 @@ DOMAINS[I.EmbedProcessor.Telegram] = [ 't.me' ];
DOMAINS[I.EmbedProcessor.Codepen] = [ 'codepen.io' ];
DOMAINS[I.EmbedProcessor.Bilibili] = [ 'bilibili.com', 'b23.tv'];
DOMAINS[I.EmbedProcessor.Kroki] = [ 'kroki.io' ];
DOMAINS[I.EmbedProcessor.GithubGist] = [ 'gist.github.com' ];
const IFRAME_PARAM = 'frameborder="0" scrolling="no" allowfullscreen';