Skip to content

Commit

Permalink
Backport PR #12027: fix run cells breaking on non-header markdown cel…
Browse files Browse the repository at this point in the history
…ls (#12405)

Co-authored-by: Andrew Fulton <andrewfulton9@gmail.com>
  • Loading branch information
meeseeksmachine and andrewfulton9 authored Apr 14, 2022
1 parent da92d1c commit 161614c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/toc-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ async function activateTOC(
let level = activeCell.headingInfo.level;
for (let i = cells.indexOf(activeCell) + 1; i < cells.length; i++) {
const cell = cells[i];
if (cell instanceof MarkdownCell && cell.headingInfo.level <= level) {
if (
cell instanceof MarkdownCell &&
cell.headingInfo.level <= level &&
cell.headingInfo.level > -1
) {
break;
}
if (cell instanceof CodeCell) {
Expand Down

0 comments on commit 161614c

Please sign in to comment.