Skip to content

Commit

Permalink
fix run cells breaking on non-header markdown cells (jupyterlab#12027)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfulton9 authored Apr 14, 2022
1 parent 95fc6e7 commit 95312de
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 @@ -111,7 +111,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;
}

Expand Down

0 comments on commit 95312de

Please sign in to comment.