Skip to content

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

Closed

Description

@chrispy-snps

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions