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

Option to disable collapseWhitespace function? #488

Open
EdrikC opened this issue Nov 28, 2024 · 2 comments
Open

Option to disable collapseWhitespace function? #488

EdrikC opened this issue Nov 28, 2024 · 2 comments

Comments

@EdrikC
Copy link

EdrikC commented Nov 28, 2024

Is there a way to disable the collapseWhitespace function similar to how it can be done for code blocks?

My original issue:

this HTML:

<p>Hello</p>
<p><br></p>
<p><br></p>
<p><br></p>
<p>World.</p>

gets converted to this MD:

Hello

World.

It seems no matter how many break tags I have, they get consolidated into just one \n.

Originally posted by @EdrikC in #487 (comment)

@martincizek
Copy link
Collaborator

Is there a way to disable the collapseWhitespace function similar to how it can be done for code blocks?

Unfortunately not, Turndown currently relies on collapsing non-semantical whitespace, so it would break the output for some inputs.

gets converted to this MD:

Can't reproduce this:
image

The reason in the former issues is that the hardbreak option was configured to as empty string, which is invalid.

@martincizek
Copy link
Collaborator

This is probably a duplicate of #361.

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

2 participants