crass 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4519ecea822a7a2632913d4ed71cb69c7258f52be999546e0cf6c3e07b3c1977
4
- data.tar.gz: 679720a3e80e1cd1b7a9a2e74918006deb3f515f1f1adef72675f2e34b031231
3
+ metadata.gz: 368a9cc84dabe98dd1d155ac2ae8cbc713183db1a4bcf51a68197c072a68bc42
4
+ data.tar.gz: 3eff45452736d400c5e875257dd009950ede94fa38d8d0714298e9ebb8615473
5
5
  SHA512:
6
- metadata.gz: f10e1e6862c2af99e8a703695cd88576cbe67d4bfd12f11d2eaed16d5a2d0bc1662a515b1e43e2e7371a0bef42f86a7af04dc1f5c4a84fe2136d7c6bebae0f47
7
- data.tar.gz: c55f035f81dbaa5a3a0abfd0fcbb2636ec151ae24e50806e3bcd871a10af281a35b3d892281a15bade02fb36bc38de945fa547110c74442e2fac3f86b910a204
6
+ metadata.gz: 96815f33850d81e980fb45a445fac9bf3f9f2e3a6df8796d7dc47fe2c1c2a14a1874b59e7bd646f23b4c36a5bbf6f9774ca045681b8d9272a278ccb0df380e6e
7
+ data.tar.gz: e98d8fbc16e403e1283c5c1d361b5788627ef6f37e342f63925e9b289e0697c078f27d4af48bbec6c0296ca17b8d6f6921ddc39ef5086ae2ebf658f4bfd2d25a
data/HISTORY.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Crass Changelog
2
2
 
3
+ ## 1.0.9 (2026-12-01)
4
+
5
+ ### Security
6
+
7
+ - Moderate: Fixed a tokenizer bug in which, with the `:preserve_hacks` option enabled, a `*` inside a name caused Crass to tokenize CSS differently than a browser would. CSS sanitizers built on Crass that enable `:preserve_hacks` could be tricked into passing through CSS that a browser would then apply. (GHSA-cpc4-vxpc-8mf7)
8
+
3
9
  ## 1.0.8 (2026-10-21)
4
10
 
5
11
  ### Security
@@ -122,9 +122,9 @@ module Crass
122
122
  @s.consume
123
123
  create_token(:substring_match)
124
124
 
125
- # Non-standard: Preserve the IE * hack.
125
+ # Non-standard: Preserve the IE * hack. The `*` is included in the
126
+ # token's raw text but not in its value.
126
127
  elsif @options[:preserve_hacks] && @s.peek =~ RE_NAME_START
127
- @s.reconsume
128
128
  consume_ident
129
129
 
130
130
  else
@@ -385,10 +385,6 @@ module Crass
385
385
  if valid_escape?(char + @s.peek)
386
386
  result << consume_escaped
387
387
 
388
- # Non-standard: IE * hack
389
- elsif char == '*' && @options[:preserve_hacks]
390
- result << @s.consume
391
-
392
388
  else
393
389
  @s.reconsume
394
390
  return result
data/lib/crass/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Crass
4
- VERSION = '1.0.8'
4
+ VERSION = '1.0.9'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crass
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Grove
@@ -44,16 +44,9 @@ executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
- - ".github/workflows/tests.yml"
48
- - ".gitignore"
49
- - ".yardopts"
50
- - Gemfile
51
47
  - HISTORY.md
52
48
  - LICENSE
53
49
  - README.md
54
- - Rakefile
55
- - SECURITY.md
56
- - crass.gemspec
57
50
  - lib/crass.rb
58
51
  - lib/crass/parser.rb
59
52
  - lib/crass/scanner.rb
@@ -65,10 +58,10 @@ licenses:
65
58
  - MIT
66
59
  metadata:
67
60
  bug_tracker_uri: https://github.com/rgrove/crass/issues
68
- changelog_uri: https://github.com/rgrove/crass/blob/v1.0.8/HISTORY.md
69
- documentation_uri: https://www.rubydoc.info/gems/crass/1.0.8
61
+ changelog_uri: https://github.com/rgrove/crass/blob/v1.0.9/HISTORY.md
62
+ documentation_uri: https://www.rubydoc.info/gems/crass/1.0.9
70
63
  rubygems_mfa_required: 'true'
71
- source_code_uri: https://github.com/rgrove/crass/tree/v1.0.8
64
+ source_code_uri: https://github.com/rgrove/crass/tree/v1.0.9
72
65
  rdoc_options: []
73
66
  require_paths:
74
67
  - lib
@@ -1,25 +0,0 @@
1
- name: Tests
2
- on: [ push, pull_request ]
3
- jobs:
4
- test:
5
- strategy:
6
- fail-fast: false
7
- matrix:
8
- os:
9
- - ubuntu-latest
10
- - macos-latest
11
- ruby:
12
- - '3.3'
13
- - '3.4'
14
- - jruby
15
- - ruby
16
- - ruby-head
17
- continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
18
- runs-on: ${{ matrix.os }}
19
- steps:
20
- - uses: actions/checkout@v7
21
- - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0
22
- with:
23
- bundler-cache: true
24
- ruby-version: ${{ matrix.ruby }}
25
- - run: bundle exec rake
data/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- .yardoc/
2
- doc/
3
- pkg/
4
- .DS_Store
5
- Gemfile.lock
data/.yardopts DELETED
@@ -1 +0,0 @@
1
- --markup markdown
data/Gemfile DELETED
@@ -1,2 +0,0 @@
1
- source 'https://rubygems.org'
2
- gemspec
data/Rakefile DELETED
@@ -1,21 +0,0 @@
1
- require 'bundler'
2
- require 'rake/testtask'
3
-
4
- Bundler::GemHelper.install_tasks
5
-
6
- Rake::TestTask.new
7
- task :default => [:test]
8
- task :test => :set_rubyopts
9
-
10
- task :set_rubyopts do
11
- ENV['RUBYOPT'] ||= ""
12
- ENV['RUBYOPT'] += " -w"
13
-
14
- if RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.3"
15
- ENV['RUBYOPT'] += " --enable-frozen-string-literal --debug=frozen-string-literal"
16
- end
17
- end
18
-
19
- task :'pull-css-tests' do
20
- sh 'git subtree pull -P test/css-parsing-tests https://github.com/SimonSapin/css-parsing-tests.git master --squash'
21
- end
data/SECURITY.md DELETED
@@ -1,3 +0,0 @@
1
- # Security Policy
2
-
3
- To report a security vulnerability in Crass, please email [ryan@wonko.com](mailto:ryan@wonko.com) or use GitHub's [Report a vulnerability](https://github.com/rgrove/crass/security/advisories/new) feature.
data/crass.gemspec DELETED
@@ -1,32 +0,0 @@
1
- # encoding: utf-8
2
- require './lib/crass/version'
3
-
4
- Gem::Specification.new do |s|
5
- s.name = 'crass'
6
- s.summary = 'CSS parser based on the CSS Syntax Level 3 spec.'
7
- s.description = 'Crass is a pure Ruby CSS parser based on the CSS Syntax Level 3 spec.'
8
- s.version = Crass::VERSION
9
- s.authors = ['Ryan Grove']
10
- s.email = ['ryan@wonko.com']
11
- s.homepage = 'https://github.com/rgrove/crass/'
12
- s.license = 'MIT'
13
-
14
- s.metadata = {
15
- 'bug_tracker_uri' => 'https://github.com/rgrove/crass/issues',
16
- 'changelog_uri' => "https://github.com/rgrove/crass/blob/v#{s.version}/HISTORY.md",
17
- 'documentation_uri' => "https://www.rubydoc.info/gems/crass/#{s.version}",
18
- 'rubygems_mfa_required' => 'true',
19
- 'source_code_uri' => "https://github.com/rgrove/crass/tree/v#{s.version}",
20
- }
21
-
22
- s.platform = Gem::Platform::RUBY
23
- s.required_ruby_version = Gem::Requirement.new('>= 1.9.2')
24
-
25
- s.require_paths = ['lib']
26
-
27
- s.files = `git ls-files -z`.split("\x0").grep_v(%r{^test/})
28
-
29
- # Development dependencies.
30
- s.add_development_dependency 'minitest', '~> 6.0.6'
31
- s.add_development_dependency 'rake', '~> 13.4.2'
32
- end