     paste: (event) ->
       paste = event.clipboardData ? event.testClipboardData
       return unless paste?
-      return for type in paste.types when type.match(/^com\.apple/)
-      event.preventDefault()
-
-      if html = paste.getData("text/html")
+
+      if pasteEventIsCrippledSafariHTMLPaste(event)
+        @getPastedHTMLUsingHiddenElement (html) =>
+          @delegate?.inputControllerWillPasteText({paste, html})
+          @responder?.insertHTML(html)
+          @requestRender()
+
+      else if html = paste.getData("text/html")
+        event.preventDefault()
         @delegate?.inputControllerWillPasteText({paste, html})
         @responder?.insertHTML(html)
+        @requestRender()
+
       else if string = paste.getData("text/plain")
+        @setInputSummary(textAdded: string, didDelete: @selectionIsExpanded())
         @delegate?.inputControllerWillPasteText({paste, string})
         @responder?.insertString(string)
 
-      if "Files" in paste.types
+      else if "Files" in paste.types
         if file = paste.items?[0]?.getAsFile?()
           if not file.name and extension = extensionForFile(file)
             file.name = "pasted-file-#{++pastedFileCount}.#{extension}"
           @delegate?.inputControllerWillAttachFiles()
-          if @responder?.insertFile(file)
-            file.trixInserted = true
-
-      @requestRender()
+          @responder?.insertFile(file)
+          @requestRender()
+
+      else
+        event.preventDefault()
 
     compositionstart: (event) ->
       @mutationObserver.stop()


keyEventIsKeyboardCommand = (event) ->
  if /Mac|^iP/.test(navigator.platform) then event.metaKey else event.ctrlKey

#= require trix/observers/mutation_observer
#= require trix/operations/file_verification_operation

{handleEvent, findClosestElementFromNode, findElementForContainerAtOffset, defer, makeElement} = Trix

inputLog = Trix.Logger.get("input")

