How to automatically generate anchor ids to CKEditor added headers
in JS, id set from the h2 label two first words :
const headings = document.querySelectorAll(
  &quot;.article--full h2, .article--full h3&quot;
);
const tocElements = createTocElementsArray(headings);

function createTocElementsArray(headings) {
  const tocElements = [];   
  for (const item of headings) {
    if (item.id === &quot;&quot;) {
      item.id = item.firstChild.data
        .split(&quot; &quot;)
        .slice(0, 2)
        .join(&quot;-&quot;);
    }
....
}