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

Support a wrap width value of None that explicitly indicates no width limit (unlimited line length) #168

Open
chrispy-snps opened this issue Dec 29, 2024 · 0 comments · May be fixed by #169

Comments

@chrispy-snps
Copy link
Collaborator

Currently we use a large numerical wrap_width value to collapse newlines inside paragraphs:

from markdownify import markdownify as md

html = "<p>" + "\n".join(["This is some text."] * 10) + "</p>"
print(md(html, wrap=True, wrap_width=1e8))
#                         ^^^^^^^^^^^^^^

However, when processing large amounts of content in batch processing (which we do), there is a runtime penalty for running all text through the wrapping code.

It would be great if wrap_width supported an explicit value of None to reflow text with no width limit:

print(md(html, wrap=True, wrap_width=None))
#                         ^^^^^^^^^^^^^^^
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

Successfully merging a pull request may close this issue.

1 participant