paolochiodi / htmlcompressor

A work in progress port of google's htmlcompressor.jar
Other
150 stars 26 forks source link

regexp has invalid interval and '}' without escape #6

Closed scottweston closed 11 years ago

scottweston commented 11 years ago

I'm using {:awestruct} and get the following warnings:

/var/lib/gems/1.8/gems/htmlcompressor-0.0.5/lib/htmlcompressor/compressor.rb:80: warning: regexp has invalid interval /var/lib/gems/1.8/gems/htmlcompressor-0.0.5/lib/htmlcompressor/compressor.rb:80: warning: regexp has }' without escape /var/lib/gems/1.8/gems/htmlcompressor-0.0.5/lib/htmlcompressor/compressor.rb:80: warning: regexp has invalid interval /var/lib/gems/1.8/gems/htmlcompressor-0.0.5/lib/htmlcompressor/compressor.rb:80: warning: regexp has}' without escape

Line at fault in compressor.rb:

LINE_BREAKPATTERN = Regexp.new("(?:\p{Blank}(\r?\n)\p{Blank}_)+")

Escaping the curly brackets certainly removes the warning but I'm not 100% if that's the correct thing to do.

Cheers, Scott.

paolochiodi commented 11 years ago

Thank for the report, I'll have a look at it soon. You are using ruby 1.8, right?

scottweston commented 11 years ago

Yup, 1.8.7. Basically I've installed it on a bare bones Debian 6.0.7 system.

$ ruby -v ruby 1.8.7 (2010-08-16 patchlevel 302) [i486-linux]

On Tue, Apr 16, 2013 at 6:43 PM, Paolo Chiodi notifications@github.comwrote:

Thank for the report, I'll have a look at it soon. You are using ruby 1.8, right?

— Reply to this email directly or view it on GitHubhttps://github.com/paolochiodi/htmlcompressor/issues/6#issuecomment-16433037 .

paolochiodi commented 11 years ago

Just pushed new gem version to rubygems. You should be able to download the fixed version with gem update htmlcompressor

scottweston commented 11 years ago

Update and tested, all good. Cheers!