Skip to content

Commit

Permalink
fix: do not assume we have a toggle heading for indented children
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Sep 17, 2022
1 parent 2ff07f1 commit 3779a1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/parser/helpers/findToggleHeadings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export const findToggleHeadings = (dom: cheerio.Root): cheerio.Element[] => {
details: null,
};
} else if (el.attribs.class === 'indented') {
toggleHeadings[i++].details = dom(element).html();
if (toggleHeadings[i + 1]) {
toggleHeadings[i++].details = dom(element).html();
}
}
}
// @ts-ignore
Expand Down

0 comments on commit 3779a1f

Please sign in to comment.