FIX: Disable previews if diffhtml is enabled (#14537)

diffhtml should not rerender video and audio elements so there is no
point in having these.
This commit is contained in:
Bianca Nenciu
2021-10-08 15:57:08 +03:00
committed by GitHub
parent 016524e244
commit ba81d1853b
4 changed files with 9 additions and 5 deletions

View File

@ -65,8 +65,8 @@ module Onebox
def placeholder_html
return article_html if (is_article? || force_article_html?)
return image_html if is_image?
return Onebox::Helpers.video_placeholder_html if is_video? || is_card?
return Onebox::Helpers.generic_placeholder_html if is_embedded?
return Onebox::Helpers.video_placeholder_html if !SiteSetting.enable_diffhtml_preview? && (is_video? || is_card?)
return Onebox::Helpers.generic_placeholder_html if !SiteSetting.enable_diffhtml_preview? && is_embedded?
to_html
end

View File

@ -23,7 +23,7 @@ module Onebox
end
def placeholder_html
::Onebox::Helpers.audio_placeholder_html
SiteSetting.enable_diffhtml_preview ? to_html : ::Onebox::Helpers.audio_placeholder_html
end
end
end

View File

@ -29,7 +29,7 @@ module Onebox
end
def placeholder_html
::Onebox::Helpers.video_placeholder_html
SiteSetting.enable_diffhtml_preview ? to_html : ::Onebox::Helpers.video_placeholder_html
end
end
end