Add hyphens to the chapter jump targets
If you have a chapter with spaces, it generates a link like "#chapter title with spaces". However, the actual headings in the notebook have hyphens:
# chapter title with spaces
--> <h1 name="#chapter-title-with-spaces">...</h1>
-
Change the function that generates the URL fragments ("#blah") and use the same escaping that jupyterlab uses. Note that a chapter can include other illegal symbols than just spaces (like /, ? and so on).