aslansky / css-sprite

css sprite generator
MIT License
733 stars 55 forks source link

Allow network-path reference "//domain.com" or "http://domain.com" for css-image-path option #48

Closed talee closed 9 years ago

talee commented 9 years ago

Currently the --css-image-path option only allows "../domain" or "/domain" paths. For certain dynamics setups (A/B tests), being able to pass in a path with a separate domain name is needed.

E.g.: HTML: domain.com CSS: domain.com IMGS: cdnDomain.com

Currently, passing in "http://cdnDomain.com" outputs to "http:/cdnDomain.com", which is incorrect and is interpreted by browsers as an absolute path ("domain.com/cdnDomain.com"). Passing in "//cdnDomain.com" also gets its "//" truncated and results in an absolute path, "/cdnDomain.com".

The expectation is that "//" should be maintained and not trimmed.