@@ -287,11 +287,24 @@ def string_or_image(prefix, text)
287
287
ext = File . extname ( path )
288
288
base_level = File . basename ( path , ext )
289
289
level = Level . find_by ( name : base_level )
290
- "<iframe src='#{ url_for ( :controller => :levels , :action => :embed_blocks , :level_id => level . id , :block_type => ext . tap { |x |x . slice! ( 0 ) } ) . strip } ' width='#{ width ? width . strip : '100%' } ' scrolling='no' seamless='seamless' style='border: none;'></iframe>"
290
+ content_tag ( :iframe , '' , {
291
+ src : url_for ( controller : :levels , action : :embed_blocks , level_id : level . id , block_type : ext . slice ( 1 ..-1 ) ) . strip ,
292
+ width : width ? width . strip : '100%' ,
293
+ scrolling : 'no' ,
294
+ seamless : 'seamless' ,
295
+ style : 'border: none;' ,
296
+ } )
291
297
elsif File . extname ( path ) == '.level'
292
298
base_level = File . basename ( path , '.level' )
293
299
level = Level . find_by ( name : base_level )
294
- "<div class='aspect-ratio'><iframe src='#{ url_for ( :id => level . id , :controller => 'levels' , :action => 'show' , :embed => true ) . strip } ' width='#{ width ? width . strip : '100%' } ' scrolling='no' seamless='seamless' style='border: none;'></iframe></div>"
300
+ content_tag ( :div ,
301
+ content_tag ( :iframe , '' , {
302
+ src : url_for ( id : level . id , controller : :levels , action : :show , embed : true ) . strip ,
303
+ width : ( width ? width . strip : '100%' ) ,
304
+ scrolling : 'no' ,
305
+ seamless : 'seamless' ,
306
+ style : 'border: none;'
307
+ } ) , { class : 'aspect-ratio' } )
295
308
else
296
309
data_t ( prefix + '.' + @level . name , text )
297
310
end
0 commit comments