diff --git a/lib/gollum-lib/macro/video.rb b/lib/gollum-lib/macro/video.rb index e2f05ebf..6a7d17de 100644 --- a/lib/gollum-lib/macro/video.rb +++ b/lib/gollum-lib/macro/video.rb @@ -1,8 +1,10 @@ module Gollum class Macro class Video < Gollum::Macro - def render (fname) - "" + def render(fname, auto=false) + escaped_fname = CGI.escapeHTML(fname) + properties = auto ? "autoplay='true' playsinline='true' muted='true' loop='true'" : "controls='true'" + "" end end end diff --git a/lib/gollum-lib/sanitization.rb b/lib/gollum-lib/sanitization.rb index 0f6ddf9f..8d6ba418 100644 --- a/lib/gollum-lib/sanitization.rb +++ b/lib/gollum-lib/sanitization.rb @@ -1,5 +1,5 @@ ::Loofah::HTML5::SafeList::ACCEPTABLE_PROTOCOLS.add('apt') -::Loofah::HTML5::SafeList::ALLOWED_ATTRIBUTES.add('controls') +::Loofah::HTML5::SafeList::ALLOWED_ATTRIBUTES.merge(%w[controls loop muted playsinline autoplay]) module Gollum class Sanitization