     groupedSelections = @groupSelectionsByPosition(@get('value.selections'), 'startPosition')
     @openTags(groupedSelections, options)
 
+    # close last tags
+    groupedEndingSelections = @groupSelectionsByPosition(options.startedSelections, 'endPosition')
+    @closeTags(groupedEndingSelections, options)
+
     # ending
     options.html += options.text.slice(options.prevPosition)
 

      options.startedSelections.removeObjects(selections)

      spanTag = '</span>'
      console.log('eee')
      spanTag += @openingSpanTag(selections) if options.startedSelections.get('length')

      options.html += beforeText + spanTag
      options.prevPosition = position

    className = selections.mapBy('id').join(' ')

    color = selections.get('lastObject.label.color')
    color = color[0] if Ember.isArray(color) #fix

    if selections.get('length') > 1
      otherColor = selections.get('firstObject.label.color')
      otherColor = otherColor[0] if Ember.isArray(otherColor) #fix
      color = $.xcolor.combine color, otherColor

    "<span class=\"#{className}\" style=\"color:#{color};\">"

  setContentOld: ->
