code: function getHtmlId(type, title, htmlIdsSet) {
      let id = type + "-" + title;
      id = stringToHtmlId(id);
      if (htmlIdsSet) {
          let originalId = id;
          let i = 1;
          while (htmlIdsSet[id]) {
              i++;
              id = originalId + "-occurrence-" + i;
          }
      }
      return id;
  }
docs: / Returns a html id of the form "type-title". / If htmlIdsSet is not null, creates an id that is not already a member of the set. / Example: If "statement-s1" is already a member of the set, it will return "statement-s1-occurrence-2". / Note that you still have to add the new id to the set yourself if you want to avoid duplicates.