     elements = []
     styles = []
 
-    for key, value of attributes
-      config = Trix.attributes[key]
-
+    for key, value of attributes when config = Trix.attributes[key]
       if config.style
         styles.push(config.style)
 


    elements

  createElementForAttachment = ({attachment, attributes, position}) ->
    switch attachment.type
      when "image"
        element = document.createElement("img")

      innerElement = child
      innerElement.trixPosition = position

    if @currentRun.attachment
      innerElement.appendChild(@createAttachmentElementForCurrentRun())
    else if string
      for node in createNodesForString(string, position)
        innerElement.appendChild(node)

