FEATURE: Onebox asciinema iframe

This commit is contained in:
Rafael dos Santos Silva 2024-01-19 13:41:10 -03:00
parent a840c295d8
commit 583c52b8b6
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -8,9 +8,10 @@ module Onebox
always_https
matches_regexp(/^https?:\/\/asciinema\.org\/a\/[\p{Alnum}_\-]+$/)
requires_iframe_origins "https://asciinema.org"
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
def placeholder_html