Skip to content

Commit

Permalink
Merge pull request #101 from apainintheneck/fix-encoding-bug-in-tests…
Browse files Browse the repository at this point in the history
…-on-ruby-3

Fix encoding bug in tests on Ruby 3
  • Loading branch information
cantino authored Nov 23, 2024
2 parents aaca620 + 51d8118 commit e652671
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.7']
ruby-version: ['2.7', '3.3']

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion lib/readability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def initialize(input, options = {})
@options = DEFAULT_OPTIONS.merge(options)
@input = input

if RUBY_VERSION =~ /^(1\.9|2)/ && !@options[:encoding]
if RUBY_VERSION =~ /^(1\.9|2|3)/ && !@options[:encoding]
@input = GuessHtmlEncoding.encode(@input, @options[:html_headers]) unless @options[:do_not_guess_encoding]
@options[:encoding] = @input.encoding.to_s
end
Expand Down

0 comments on commit e652671

Please sign in to comment.