Skip to content

Commit

Permalink
Make SAX Parser nokogiri 17 compatible
Browse files Browse the repository at this point in the history
Due to changes in nokogiri 17, the SAX parser now needs a default
encoding: sparklemotion/nokogiri#3288
  • Loading branch information
bihorco36 committed Dec 17, 2024
1 parent 1279dd4 commit 8e81bbd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/prawn/markup/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def parse(html)

reset
html = Prawn::Markup::Normalizer.new(html).normalize
Nokogiri::HTML::SAX::Parser.new(self).parse(html) { |ctx| ctx.recovery = true }
Nokogiri::HTML::SAX::Parser.new(self, html.encoding&.to_s).parse(html) do |ctx|
ctx.recovery = true
end
end

def start_element(name, attrs = [])
Expand Down

0 comments on commit 8e81bbd

Please sign in to comment.