css_parser 1.19.0 → 1.20.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5597d8abc3bd6dac3e4f4c7bb241cc4e1110ee0bdae226870ec35ab7ba85ee4f
4
- data.tar.gz: 7191e6f6768060de7ddedc0420b0650046ca329bfbf5ef42444b342970eab752
3
+ metadata.gz: 7685aa4f55ebd1d9abde202f1d4f03e9215e494ae01daf44713286311e339e7f
4
+ data.tar.gz: 2d60924c9ada315c9bf8c4e5ce8186b27df4f5a6e5cddef4287f4df190c45a63
5
5
  SHA512:
6
- metadata.gz: d8a71809154ea8535a22709a8877a6d8c7a93ada53a42e1a497ef8893292a261580fc1f2aa65c723d217498124278e2c226dafc69f2549cdbff0b6b4a7eb8895
7
- data.tar.gz: 8c644bed6fe56143c4ccc5fe02a29e98de9cc728efdc7881f1816a10e562faf0a4e67210ff329068d4b5a2bb377239cfcd25b5594527b893522fbd6ec7cfa994
6
+ metadata.gz: 65bce8402032a1b8f159e1133eb1cc76f7ca104113d3e8191fd7eab2eda6796409f50a6208e58e867cd057b8128bf584dcf7b59de7f9e829512ec711fbed4322
7
+ data.tar.gz: 5dcc28bc5cebe61327e3d492502d849d59c438d7704d4e355f8b5c845b2d02897972df53a5b842bcb5da19baf92854e9014fdf9a100519a3c9c3d8cc1912f17a
@@ -677,12 +677,7 @@ module CssParser
677
677
  end
678
678
 
679
679
  if charset
680
- if String.method_defined?(:encode)
681
- src.encode!('UTF-8', charset)
682
- else
683
- ic = Iconv.new('UTF-8//IGNORE', charset)
684
- src = ic.iconv(src)
685
- end
680
+ src.encode!('UTF-8', charset)
686
681
  end
687
682
  rescue
688
683
  @redirect_count = nil
@@ -31,6 +31,7 @@ module CssParser
31
31
  SEMICOLON = ';'.freeze
32
32
  LPAREN = '('.freeze
33
33
  RPAREN = ')'.freeze
34
+ IMPORTANT = '!important'.freeze
34
35
  class Declarations
35
36
  class Value
36
37
  attr_reader :value
@@ -667,7 +668,7 @@ module CssParser
667
668
  value = decs[(colon + 1)..]
668
669
  property.strip!
669
670
  value.strip!
670
- next if property.empty? || value.empty?
671
+ next if property.empty? || value.empty? || value.casecmp?(IMPORTANT)
671
672
 
672
673
  add_declaration!(property, value)
673
674
  continuation = nil
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CssParser
4
- VERSION = '1.19.0'.freeze
4
+ VERSION = '1.20.0'.freeze
5
5
  end
data/lib/css_parser.rb CHANGED
@@ -6,7 +6,6 @@ require 'net/https'
6
6
  require 'digest/md5'
7
7
  require 'zlib'
8
8
  require 'stringio'
9
- require 'iconv' unless String.method_defined?(:encode)
10
9
 
11
10
  require 'css_parser/version'
12
11
  require 'css_parser/rule_set'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.0
4
+ version: 1.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dunae
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-23 00:00:00.000000000 Z
11
+ date: 2024-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable