auto mdText = "## first\n## second\n### third\n# fourth\n### fifth"; auto expected = [ Section(2, " first", "first"), Section(2, " second", "second", [Section(3, " third", "third")]), Section(1, " fourth", "fourth", [Section(3, " fifth", "fifth")]) ]; assert(getMarkdownOutline(mdText) == expected);
Returns the hierarchy of sections.