     return if elementCanDisplayNewlines(node.parentNode)
     isBlockElement(node.previousSibling) and isBlockElement(node.nextSibling)
 
+  isExtraBR = (element) ->
+    tagName(element) is "br" and
+      isBlockElement(element.parentNode) and
+      element.parentNode.lastChild is element
+
   elementCanDisplayNewlines = (element) ->
     {whiteSpace} = window.getComputedStyle(element)
     whiteSpace in ["pre", "pre-wrap", "pre-line"]

    else
      switch tagName(element)
        when "br"
          unless @isExtraBR(element) or isBlockElement(element.nextSibling)
            @appendStringWithAttributes("\n", @getTextAttributes(element))
          @processedElements.push(element)
        when "img"

        {parentElement} = parentElement
    null

  processTextNode: (node) ->
    if string = normalizeSpaces(node.data)
      unless elementCanDisplayNewlines(node.parentNode)
