lib/roadie/document.rb in roadie-3.1.1 vs lib/roadie/document.rb in roadie-3.2.0
- old
+ new
@@ -65,12 +65,11 @@
inline dom
rewrite_urls dom
callback after_transformation, dom
- # #dup is called since it fixed a few segfaults in certain versions of Nokogiri
- dom.dup.to_html
+ serialize_document dom
end
# Assign new normal asset providers. The supplied list will be wrapped in a {ProviderList} using {ProviderList.wrap}.
def asset_providers=(list)
@asset_providers = ProviderList.wrap(list)
@@ -95,9 +94,19 @@
Inliner.new(dom_stylesheets + [stylesheet], dom).inline(keep_uninlinable_css)
end
def rewrite_urls(dom)
make_url_rewriter.transform_dom(dom)
+ end
+
+ def serialize_document(dom)
+ # #dup is called since it fixed a few segfaults in certain versions of Nokogiri
+ save_options = Nokogiri::XML::Node::SaveOptions
+ dom.dup.to_html(
+ save_with: (
+ save_options::NO_DECLARATION | save_options::NO_EMPTY_TAGS | save_options::AS_HTML
+ )
+ )
end
def make_url_rewriter
if url_options
UrlRewriter.new(UrlGenerator.new(url_options))