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"
|
require "rack/livereload"
|
||||||
|
|
||||||
class Rack::LiveReload
|
class Rack::LiveReload
|
||||||
VERSION = '0.3.9'
|
VERSION = '0.4.0'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ module Rack
|
||||||
template = ERB.new(::File.read(::File.expand_path('../../../skel/livereload.html.erb', __FILE__)))
|
template = ERB.new(::File.read(::File.expand_path('../../../skel/livereload.html.erb', __FILE__)))
|
||||||
|
|
||||||
if line['<head']
|
if line['<head']
|
||||||
line.gsub!(/<head[^>]*>/) { |match| %{#{match}#{template.result(binding)}} }
|
line.gsub!(/<head(\s[^>])*>/) { |match| %{#{match}#{template.result(binding)}} }
|
||||||
end
|
end
|
||||||
|
|
||||||
headers["X-Rack-LiveReload"] = '1'
|
headers["X-Rack-LiveReload"] = '1'
|
||||||
|
|
Loading…
Reference in New Issue