danielfrg/mkdocs-jupyter

Comments in code cells break nav structure

Peter9192 opened this issue · 1 comments

Thanks for the nice plugin!

I noticed that a notebook with a markdown code cell like below breaks the headers in the navigation side bar:

# Example notebook

This represents a top markdown cell.

some text

## Header before code block 
This header is shown in sidebar

Let's say I want to give an example code (not a code cell, just a code block in markdown)
Using double backticks below as I have no clue how to render nested fenced code blocks in a github issue.

``python
1+1 = 2

# This seems off:
1+1=3
`` 

## Header after code block
This header is not shown in the sidebar.

Would it be possible to ignore hashtags in markdown code block while parsing the notebook?

+1 to this, I'm also having the same issue.

I've been using a hack of turning code blocks into images, however, this is not ideal long-term.

Perhaps it's an issue with nbconvert?

I'm reading old issues here: ipython/ipython#5345

But they may be unrelated.