Don't insert livereload script tag after <header> tags
This commit is contained in:
parent
ebeb331f0f
commit
25a0d6465c
@ -1,6 +1,6 @@
|
||||
require "rack/livereload"
|
||||
|
||||
class Rack::LiveReload
|
||||
VERSION = '0.3.9'
|
||||
VERSION = '0.4.0'
|
||||
end
|
||||
|
||||
|
@ -77,7 +77,7 @@ module Rack
|
||||
template = ERB.new(::File.read(::File.expand_path('../../../skel/livereload.html.erb', __FILE__)))
|
||||
|
||||
if line['<head']
|
||||
line.gsub!(/<head[^>]*>/) { |match| %{#{match}#{template.result(binding)}} }
|
||||
line.gsub!(/<head(\s[^>])*>/) { |match| %{#{match}#{template.result(binding)}} }
|
||||
end
|
||||
|
||||
headers["X-Rack-LiveReload"] = '1'
|
||||
|
Loading…
Reference in New Issue
Block a user