Skip to content

Commit

Permalink
Backport PR jupyterlab#12027: fix run cells breaking on non-header ma…
Browse files Browse the repository at this point in the history
…rkdown cells
  • Loading branch information
andrewfulton9 authored and meeseeksmachine committed Apr 14, 2022
1 parent fc78ad3 commit b8d1631
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/toc-extension/src/index.ts
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 b8d1631

Please sign in to comment.