mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 03:48:23 +00:00
FEATURE: Onebox asciinema iframe
This commit is contained in:
parent
a840c295d8
commit
583c52b8b6
@ -8,9 +8,10 @@ module Onebox
|
|||||||
|
|
||||||
always_https
|
always_https
|
||||||
matches_regexp(/^https?:\/\/asciinema\.org\/a\/[\p{Alnum}_\-]+$/)
|
matches_regexp(/^https?:\/\/asciinema\.org\/a\/[\p{Alnum}_\-]+$/)
|
||||||
|
requires_iframe_origins "https://asciinema.org"
|
||||||
|
|
||||||
def to_html
|
def to_html
|
||||||
"<script type='text/javascript' src='https://asciinema.org/a/#{match[:asciinema_id]}.js' id='asciicast-#{match[:asciinema_id]}' async></script>"
|
"<iframe src='https://asciinema.org/a/#{match[:asciinema_id]}/iframe' width='100%' height='530px' frameborder='0' style='border:0' async>"
|
||||||
end
|
end
|
||||||
|
|
||||||
def placeholder_html
|
def placeholder_html
|
||||||
|
Loading…
x
Reference in New Issue
Block a user