1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
This commit is contained in:
Thomas Walpole 2014-06-27 16:08:04 -07:00
parent 02f3003601
commit 6e0130ed52

View file

@ -40,11 +40,9 @@ module Capybara
# @return [String] The modified HTML code
#
def inject_asset_host(html)
if Capybara.asset_host and
Nokogiri::HTML(html).css("base").empty? and
if Capybara.asset_host && Nokogiri::HTML(html).css("base").empty?
match = html.match(/<head[^<]*?>/)
html.clone.insert match.end(0), "<base href='#{Capybara.asset_host}' />"
end
else
html
end