nbsphinx icon indicating copy to clipboard operation
nbsphinx copied to clipboard

Markdown headers rendered incorrectly

Open manycoding opened this issue 5 years ago • 2 comments

#315 #164 nbsphinx 0.4.2 pandoc 2.7.1

## H2
#### H4

results in h3 headers for both in HTML.

Ipynb with rendered html Archive.zip

manycoding avatar Sep 05 '19 15:09 manycoding

Thanks for the report!

It looks like all headers are turned into h3, regardless of their actual level.

In fact, they are set to one level deeper than the surrounding level.

I have no idea why this happens, but I guess it happens in sphinx.util.nodes.nested_parse_with_titles(). I don't know if that's expected behavior or a bug in Sphinx. I might also have used the function wrong.

See #152 and #153.

mgeier avatar Sep 10 '19 17:09 mgeier

Hi, there. I faced the similar problem and have solved it.

The cause of the problem I faced was that some header's level were NOT increasing consecutively as follows.

# Title
### sub-title
* xxx

When I improved all header to consecutively increase in the notebook as follows, the problem was eliminated.

# Title
## sub-title
* xxx

I don't know whether this is the problem or the known specification of nbsphinx or sphinx. I'm sorry to bother you guys, if the problem I written above is NOT related to yours.

Thanks!

keisen avatar Jul 11 '21 06:07 keisen