docs: function insertInto(annotations, index, text, afterExisting) {
    for (let i = 0; i < annotations.length; ++i) {
      if (annotations[i].index >= index) {
        if (afterExisting) {
          while (i < annotations.length && annotations[i].index === index) {
            ++i;
          }
        }
  
        annotations.splice(i, 0, { index, text });
        return;
      }
    }
    annotations.push({ index, text });
  }