Skip to content

Commit

Permalink
Force conversion to String for Rails 7.1+ compatibility
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Wienert <[email protected]>
  • Loading branch information
marcandre and zealot128 committed Oct 16, 2023
1 parent 4490194 commit 49a16ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/inky.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def initialize(options = {})
end

def release_the_kraken(html_string)
# Force conversion to string. (required for Rails 7.1+)
html_string = html_string.to_s

if html_string.encoding.name == "ASCII-8BIT"
html_string.force_encoding('utf-8') # transform_doc barfs if encoding is ASCII-8bit
end
Expand Down

0 comments on commit 49a16ff

Please sign in to comment.