diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e0e55c6..f562aa0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ master * Correctly show file names of GZIP'ed assets. #1364 * Build file output is not parallel-ized! Use `middleman build --no-parallel` to disable. * Make template file extensions that get layouts by default configurable via `config[:extensions_with_layout]` +* Remove `=` from inline url matcher. This means paths in HTML attributes MUST be quoted. Fixes #1780 # 4.0.0 diff --git a/middleman-core/features/asset_host.feature b/middleman-core/features/asset_host.feature index 4cd733aa..646f1154 100644 --- a/middleman-core/features/asset_host.feature +++ b/middleman-core/features/asset_host.feature @@ -17,6 +17,8 @@ Feature: Alternate between multiple asset hosts When I go to "/stylesheets/asset_host.css" Then I should see content matching %r{http://assets1.example.com/} Then I should not see content matching %r{http://assets1.example.com//} + When I go to "/javascripts/asset_host.js" + Then I should not see content matching %r{http://assets1.example.com/} Scenario: Set proc host with inline-option Given a fixture app "asset-host-app" diff --git a/middleman-core/lib/middleman-core/util.rb b/middleman-core/lib/middleman-core/util.rb index f492a54d..cfbcb9ee 100644 --- a/middleman-core/lib/middleman-core/util.rb +++ b/middleman-core/lib/middleman-core/util.rb @@ -341,7 +341,7 @@ module Middleman Contract String, String, ArrayOf[String], Proc => String def rewrite_paths(body, _path, exts, &_block) - matcher = /([=\'\"\(,]\s*)([^\s\'\"\)>]+(#{Regexp.union(exts)}))/ + matcher = /([\'\"\(,]\s*)([^\s\'\"\)>]+(#{Regexp.union(exts)}))/ url_fn_prefix = 'url('