File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
lib/jekyll-spaceship/processors Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -178,13 +178,14 @@ def handle_audio(element, data)
178178 " #{ cfg [ 'loop' ] ? 'loop' : '' } " \
179179 " src=\" #{ cfg [ 'src' ] } \" " \
180180 " style=\" #{ cfg [ 'style' ] } \" " \
181- " controls= \" true \" >" \
182- "<p> Your browser doesn't support HTML5 audio." \
181+ " controls>" \
182+ " Your browser doesn't support HTML5 audio." \
183183 " Here is a <a href=\" #{ cfg [ 'src' ] } \" >link to download the audio</a>" \
184- " instead. </p> " \
184+ " instead." \
185185 "</audio>"
186- doc = Nokogiri ::XML ( html )
187- element . replace ( doc . children . first )
186+ doc = Nokogiri ::HTML ( html )
187+ return if element . parent . nil?
188+ element . replace ( doc . at ( 'body' ) . children . first )
188189 end
189190
190191 def handle_iframe ( element , data )
@@ -201,8 +202,9 @@ def handle_iframe(element, data)
201202 " frameborder=\" #{ cfg [ 'frameborder' ] } \" " \
202203 " allowfullscreen>" \
203204 "</iframe>"
204- doc = Nokogiri ::XML ( html )
205- element . replace ( doc . children . first )
205+ doc = Nokogiri ::HTML ( html )
206+ return if element . parent . nil?
207+ element . replace ( doc . at ( 'body' ) . children . first )
206208 end
207209
208210 def get_id_from_html ( url , pattern )
You can’t perform that action at this time.
0 commit comments