code: function(text, length) {
    var div = document.createElement('div')
    var node = document.createTextNode(text)
    div.appendChild(node)
    var abbreviated = div.textContent
    if (abbreviated.length <= length) {
      return text
    }
  
    var lastWhitespaceIndex = abbreviated.substring(0, length - 1).lastIndexOf(' ')
    abbreviated = abbreviated.substring(0, lastWhitespaceIndex) + '\u2026'
  
    return abbreviated
  }
docs: abbreviate at last blank before length and add "\u2026" (horizontal ellipsis)