def transform
      dom = Nokogiri::HTML.parse html

      callback before_transformation, dom

      improve dom
      inline dom, keep_uninlinable_in: :head
      rewrite_urls dom

      callback after_transformation, dom

      remove_ignore_markers dom
      serialize_document dom
    end
def transform
      dom = Nokogiri::HTML.parse html

      callback before_transformation, dom

      improve dom
      inline dom, keep_uninlinable_in: :head
      rewrite_urls dom

      callback after_transformation, dom

      remove_ignore_markers dom
      serialize_document dom
    end
Transform the input HTML as a full document and returns the processed
 HTML.

 Before the transformation begins, the {#before_transformation} callback
 will be called with the parsed HTML tree and the {Document} instance, and
 after all work is complete the {#after_transformation} callback will be
 invoked in the same way.

 Most of the work is delegated to other classes. A list of them can be
 seen below.

 @see MarkupImprover MarkupImprover (improves the markup of the DOM)
 @see Inliner Inliner (inlines the stylesheets)
 @see UrlRewriter UrlRewriter (rewrites URLs and makes them absolute)
 @see #transform_partial Transforms partial documents (fragments)

 @return [String] the transformed HTML