Re: Comment syntax

On Tue, Aug 28, 2012 at 11:53 PM, Kang-Hao (Kenny) Lu
<kanghaol@oupeng.com> wrote:
> (12/08/27 20:07), Pete Boere wrote:
>> Double slashes in unquoted urls would trip-up regex based minification.
>>
>> @import url( http://dont.com/even/look.css )
>> @import url( sccidental//but-valid/double/slash-path.css )
>
> Good point. You need to isolate unquoted url(), as long as strings,
> before removing comments. In fact, if you don't do that, the
> minification would already be buggy in a case like
>
>   @import url( /path/*file* )
>
> , where "/*" is mistreated as the start of a comment.

Yes, urls are tokens in their own right, and comments can't appear
inside of them.  url() is a *very* special function.

> By the way, the Drupal CSS minimizer turns line feeds to whitespaces,
> like YUI compressor, so it's in the list problematic CSS minimizers (if
> we are adding //-style comments).

Good to know.  That makes it less likely we could add this. :/

~TJ

Received on Wednesday, 29 August 2012 07:20:12 UTC