Skip to content

Commit

Permalink
Fix call to Nokogiri::HTML5::Document to really be a DocumentFragment…
Browse files Browse the repository at this point in the history
…. This was generating spurious body and head tags in Ruby 3.4.
  • Loading branch information
threeplanetssoftware committed Dec 31, 2024
1 parent 17f3836 commit 3623f64
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/AppleNote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,7 @@ def generate_html(individual_files: false, use_uuid: false)
# a Hash of AppleNotesEmbeddedObjects as +embedded_objects+. It returns a String containing
# appropriate HTML for the document.
def self.htmlify_document(document_proto, embedded_objects, individual_files=false)
doc = Nokogiri::HTML5::Document.parse("", nil, "utf-8")
node = doc.at_css("body")
node = Nokogiri::HTML5::DocumentFragment.parse("", nil, encoding: "utf-8")

# Tables cells will be a MergableDataProto
root_node = document_proto
Expand Down Expand Up @@ -685,7 +684,7 @@ def self.htmlify_document(document_proto, embedded_objects, individual_files=fal

end

doc
node
end

##
Expand Down

0 comments on commit 3623f64

Please sign in to comment.