Skip to content

Commit 620b7da

Browse files
committed
Make SAX Parser nokogiri 17 compatible
Due to changes in nokogiri 17, the SAX parser now needs a default encoding: sparklemotion/nokogiri#3288
1 parent 1279dd4 commit 620b7da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/prawn/markup/processor.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ def parse(html)
4949

5050
reset
5151
html = Prawn::Markup::Normalizer.new(html).normalize
52-
Nokogiri::HTML::SAX::Parser.new(self).parse(html) { |ctx| ctx.recovery = true }
52+
Nokogiri::HTML::SAX::Parser.new(self, html.encoding&.to_s).parse(html) do |ctx|
53+
ctx.recovery = true
54+
end
5355
end
5456

5557
def start_element(name, attrs = [])

0 commit comments

Comments
 (0)