Skip to content

Commit

Permalink
Merge pull request #174 from tagliala/chore/fix-match-missed
Browse files Browse the repository at this point in the history
Fix `match?` that were not detected by RuboCop
  • Loading branch information
grosser authored Dec 14, 2024
2 parents cff1ddb + f6addfb commit 54b8ea5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Unreleased

* Minor performance improvements

### Version v1.21.0

* Minor performance improvements
Expand Down
4 changes: 2 additions & 2 deletions lib/css_parser/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def parse_block_into_rule_sets!(block, options = {}) # :nodoc:
current_media_query << token << ' '
end
end
elsif in_charset or token =~ /@charset/i
elsif in_charset or /@charset/i.match?(token)
# iterate until we are out of the charset declaration
in_charset = !token.include?(';')
elsif !in_string && token.include?('}')
Expand All @@ -467,7 +467,7 @@ def parse_block_into_rule_sets!(block, options = {}) # :nodoc:
current_selectors << token

# mark this as the beginning of the selector unless we have already marked it
rule_start = start_offset if options[:capture_offsets] && rule_start.nil? && token =~ /^[^\s]+$/
rule_start = start_offset if options[:capture_offsets] && rule_start.nil? && /^[^\s]+$/.match?(token)
end
end

Expand Down

0 comments on commit 54b8ea5

Please sign in to comment.