docs: function calculateFit() {
        // ignore any further processing if we have total lines
        if (lineCount > lineClamp) {
          // move to the next word
          nextWord();
          return;
        }
        // create a text node to measure
        textNode = ctn(text.substr(lineStart, pos - lineStart));
        // place relevant nodes into the measurement element
        appendNodeAndQueueToElement(measure, textNode, pendingQueue);
        // take the measurement
        measureWidth = measure.clientWidth;
        // remove text node from node stack
        if (nodeStack.length) {
          nodeStack[nodeStack.length - 1].removeChild(textNode);
        }
        // have we exceeded allowed line width?
        if (lineWidth <= measureWidth) {
          if(wasNewLine) {
            // we have a long word so it gets a line of it's own
            lineText = text.substr(lineStart, Math.min(pos + 1, text.length) - lineStart);
            // next line start position
            lineStart = Math.min(pos + 1, text.length);
            // move to the next word
            nextWord();
          } else {
            // grab the text until this word
            lineText = text.substr(lineStart, wordStart - lineStart);
            // next line start position
            lineStart = wordStart;
          }
          // create a line element
          line = ce('span');
          // add text to the line element
          appendNodeAndQueueToElement(line, ctn(lineText), pendingQueue);
          // add the line element to the container
          el.appendChild(line);
          // flush the queue
          pendingQueue = [];
          // refresh the stack
          nodeStack = nodeStack.map((node) => node.cloneNode(false));
          // yes, we created a new line
          wasNewLine = true;
          ++lineCount;
        } else {
          // did not create a new line
          wasNewLine = false;
          // move to the next word
          nextWord();
        }
        // clear measurement element
        while (measure.firstChild !== null) {
          measure.removeChild(measure.firstChild);
        }
      }