def transform_partial
      dom = Nokogiri::HTML.fragment html

      callback before_transformation, dom

      inline dom, keep_uninlinable_in: :root
      rewrite_urls dom

      callback after_transformation, dom

      serialize_document dom
    end
def transform_partial
      dom = Nokogiri::HTML.fragment html

      callback before_transformation, dom

      inline dom, keep_uninlinable_in: :root
      rewrite_urls dom

      callback after_transformation, dom

      serialize_document dom
    end
Transform the input HTML as a HTML fragment/partial 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.

 The main difference between this and {#transform} is that this does not
 treat the HTML as a full document and does not try to fix it by adding
 doctypes, {<head>} elements, etc.

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

 @see Inliner Inliner (inlines the stylesheets)
 @see UrlRewriter UrlRewriter (rewrites URLs and makes them absolute)
 @see #transform Transforms full documents

 @return [String] the transformed HTML