       piece.string = string + piece.string
     else
       text.unshift(pieceForString(string))
+
+  pieceForString = (string, attributes = {}) ->
+    type = "string"
+    string = normalizeSpaces(string)
+    {string, attributes, type}
+
+  pieceForAttachment = (attachment, attributes = {}) ->
+    type = "attachment"
+    {attachment, attributes, type}
+
+  blockForAttributes = (attributes = {}) ->
+    text = []
+    {text, attributes}
+
+  # Attribute parsing
 
   getTextAttributes: (element) ->
     attributes = {}


  getDocument: ->
    Trix.Document.fromJSON(@blocks)

  parse: ->
    try

      element = element.parentNode
    ancestors

  getAttachmentAttributes = (element) ->
    JSON.parse(element.dataset.trixAttachment)

  getImageDimensions = (element) ->
    width = element.getAttribute("width")
