         @processElementNode(node)
 
   appendBlockForNode: (node) ->
-    if @currentBlockElement?
-      unless @currentBlockElement.contains(node)
-        @appendBlockForAttributes({})
-        delete @currentBlockElement
-
-    if node.nodeType is Node.ELEMENT_NODE
-      if window.getComputedStyle(node).display is "block"
-        switch node.tagName.toLowerCase()
-          when "blockquote"
-            @appendBlockForAttributes(quote: true)
-            @currentBlockElement = node
-          when "pre"
-            @appendBlockForAttributes(code: true)
-            @currentBlockElement = node
+    unless @currentBlockElement?.contains(node)
+      if node.nodeType is Node.ELEMENT_NODE
+        if window.getComputedStyle(node).display is "block"
+          switch node.tagName.toLowerCase()
+            when "blockquote"
+              @appendBlockForAttributes(quote: true)
+              @currentBlockElement = node
+            when "pre"
+              @appendBlockForAttributes(code: true)
+              @currentBlockElement = node
+            when "div"
+              @appendBlockForAttributes()
+              @currentBlockElement = node
 
     unless @blocks.length
       @appendBlockForAttributes({})

    style = window.getComputedStyle(element)

    for attribute, config of Trix.attributes
      if config.parser
        if value = config.parser({element, style})
          attributes[attribute] = value
      else if config.tagName
        if element.tagName?.toLowerCase() is config.tagName
          attributes[attribute] = true
    attributes

  getMetadata = (element) ->

      when "br"
        unless nodeIsExtraBR(node)
          @appendStringWithAttributes("\n", getAttributes(node))
      when "figure"
        if node.classList.contains("attachment")
          attributes = getMetadata(node)
          textAttributes = getAttributes(node)
          if image = node.querySelector("img")
            textAttributes.width = image.width if image.width?
            textAttributes.height = image.height if image.height?
          @appendAttachmentForAttributes(attributes, textAttributes)
          # We have everything we need so avoid processing inner nodes
          node.innerHTML = ""

