Given an HTML container that contains one or more header elements, an object
or array of objects like those generated by tools like EditorJS, or even a
plain string of HTML content, this method will return a hierarchical representation
of the headers in a manner suitable for generating a table of contents.
Given an HTML container that contains one or more header elements, an object or array of objects like those generated by tools like EditorJS, or even a plain string of HTML content, this method will return a hierarchical representation of the headers in a manner suitable for generating a table of contents.