In notebooks that print multiple lines of text in the output of a cell, the conversion generates a single <p> element with all the text. However, by default newlines are not shown by <p> unless it has style white-space: pre-wrap, therefore, the resulting HTML page lacks the line breaks.
This problem does not happen when invoking nbconvert with --to html. There, the output is converted to a <pre> element.
I tried to find the cause in the code, but I am not familiar with the internals of nbconvert, so I couldn't find anything. Can you help? Thanks.
In notebooks that print multiple lines of text in the output of a cell, the conversion generates a single
<p>element with all the text. However, by default newlines are not shown by<p>unless it has stylewhite-space: pre-wrap, therefore, the resulting HTML page lacks the line breaks.This problem does not happen when invoking nbconvert with
--to html. There, the output is converted to a<pre>element.I tried to find the cause in the code, but I am not familiar with the internals of nbconvert, so I couldn't find anything. Can you help? Thanks.