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 and gabalafou committed Apr 19, 2022
1 parent 9837b90 commit 265751f
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 265751f

Please sign in to comment.