code: function generateCFIs(cfiBase, elements, needOffset) {
  
      const cfiList = [];
  
      for (const key in elements) {
  
          const cfiParts = [];
  
          const textNode = elements[key].textNode;
          var child = textNode.parent();
          const childContents = child.contents();
  
  
          var textNodeIndex = childContents.index(textNode) + 1;
  
          // "mixed content" context
          // the first chunk is located before the first child element
          // <p><span></span>text</p>
          if (childContents.first()[0].type === "tag") {
              textNodeIndex += 1;
          }
  
          var parent = child.parent();
          while (parent[0]) {
              const index = child.index(),
                  inOff = (needOffset && parent[0].name === 'body'),
                  id = child.attr('id'),
                  idSelector = id ? '[' + id + ']' : '',
                  part = ((index + 1) * 2 + (inOff ? 2 : 0)) + idSelector;
  
              cfiParts.unshift(part);
  
              child = parent;
              parent = child.parent();
          }
          const startOffset = elements[key].range.startOffset,
              endOffset = elements[key].range.endOffset;
  
          const inlinePath = ',/' + textNodeIndex + ':';
          const cfi = cfiBase + '/' + cfiParts.join('/') + inlinePath + startOffset + inlinePath + endOffset;
  
          cfiList.push({ cfi, excerpt: elements[key].excerpt });
      }
      return cfiList;
  }
docs: ************
  private
  ***********