Skip to content

Newlines not collapsed from HTML #31

@Numerlor

Description

@Numerlor

After 97c78ef was merged, the newlines in the parsed HTML are no longer collapsed into normal spaces, resulting in erroneous line breaks in the output.

import markdownify

print(repr(markdownify.markdownify("""\
continuous
line of
text
""")))

In 0.6.1 the above code outputs 'continuous line of text' like it'd look like when rendered in a browser,
while in 0.6.3 it preserves the newlines and outputs 'continuous\nline of\ntext'
This causes issues when the html is wrapped to some length or linebreaks are used to separate out tags, for example

text before link
<a href="link">link text</a>
continued text

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions