Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline text loses line breaks #15

Open
noe opened this issue Jan 11, 2024 · 1 comment
Open

Multiline text loses line breaks #15

noe opened this issue Jan 11, 2024 · 1 comment

Comments

@noe
Copy link

noe commented Jan 11, 2024

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.

@noe
Copy link
Author

noe commented Jan 11, 2024

After digging a bit more, I have seen that there is a template and that changing the block output to have <pre> instead of <p> fixes my issue. I don't know if this may cause undesired effects.

In case such a modification is not deemed appropriate, I have seen that it's possible to specify the template for nbconvert (with --template), so I can address this problem without any modification to nb2mail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant