File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
app/helpers/better_together
spec/helpers/better_together Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ module ContentHelper
1717
1818 YOUTUBE_DOMAINS = %w[
1919 youtube.com www.youtube.com m.youtube.com youtu.be
20+ youtube-nocookie.com www.youtube-nocookie.com
2021 ] . freeze
2122
2223 def safe_html ( html )
Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ module BetterTogether
2626 expect ( output ) . to include ( 'src="https://www.youtube.com/embed/xyz"' )
2727 end
2828
29+ it 'allows youtube-nocookie iframes' do
30+ input = '<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/xyz" frameborder="0" allowfullscreen></iframe>'
31+ output = helper . safe_html ( input )
32+ expect ( output ) . to include ( '<iframe' )
33+ expect ( output ) . to include ( 'src="https://www.youtube-nocookie.com/embed/xyz"' )
34+ end
35+
2936 it 'strips non-youtube iframes' do
3037 input = '<iframe src="https://evil.com/video"></iframe>'
3138 output = helper . safe_html ( input )
You can’t perform that action at this time.
0 commit comments