Add specific check for TLD-like strings when replacing inline urls. Fixes #1751

This commit is contained in:
Thomas Reynolds 2016-01-14 14:29:45 -08:00
parent be2788b6ca
commit a47b2138f8
3 changed files with 11 additions and 1 deletions

View file

@ -349,7 +349,7 @@ module Middleman
begin
uri = ::Addressable::URI.parse(asset_path)
if uri.relative? && uri.host.nil? && (result = yield asset_path)
if uri.relative? && uri.host.nil? && !asset_path.match(/^[^\/].*[a-z]+\.[a-z]+\/.*/) && (result = yield(asset_path))
"#{opening_character}#{result}"
else
match