Open jp68138743541 opened 4 years ago
I have investigated the problem a bit further down the rabbit hole. It seems that this is a problem of lxml. If the call to replfunc is commented out, the problem still persists, which means that the calls to the lxml functions fromstring and tostring mess things up.
I regularly use the EmbedHTMLExporter to generate reports including plotly graphics, but occasionally, the browser cannot render the report and displays only parts of it. Now I managed to create a reproducible example. The problem seems to be that the EmbedHTMLExporter stops the figure data suddenly, which breaks the html format. If I use the EmbedHTMLExporter on the report (see attached zip file), I get this file ending (last 200 characters):
[...]:59.286626300", "2018-05-30 08:58:59.473826300", "2018-05-30 08:58:59.676626300", "2018-05-30 08:58:59.879426300", "2018-05-30 08</script></div></div></div></div></div></div></div></div></body></html>
Using the default nbconverter, I get this output (again, only the last 200 characters):[...]><div class="inner_cell"> <div class="input_area"><div class=" highlight hl-ipython3"><pre><span></span> </pre></div> </div></div></div></div> </div> </div></body></html>
To make reproduction easier, I tested the script within the jupyter docker container. Just run
docker pull jupyter/scipy-notebook
anddocker run -p 8888:8888 jupyter/scipy-notebook
. Now you can access jupyter athttp://127.0.0.1:8888
. Upload the files from the attached zip file, run the first cell from setupAndConversion.ipynb in order to install the dependencies, execute the report.ipynb, save the notebook and execute the second and third cell from setupAndConversion.ipynb. That should give you the mangled output posted above.report.zip