matthewwithanm / python-markdownify

Convert HTML to Markdown
MIT License
1.02k stars 135 forks source link

Tidy HTML breaks result #88

Open nachitox opened 1 year ago

nachitox commented 1 year ago

On version 0.11.6 when I run:

markdownify("<h2>\n\tHeadline 2 on new line\n</h2>", heading_style="ATX")

I expect this:

## Headline 2 on new line\n\n

but I get this:

'## \n Headline 2 on new line\n\n'

which I believe is a bug.

5yato4ok commented 1 year ago

Yes, I believe a tiny fix should remove the bug. https://github.com/matthewwithanm/python-markdownify/pull/89

mirabilos commented 1 year ago

Possibly a duplicate of https://github.com/matthewwithanm/python-markdownify/issues/31 (and see my comment there, maybe the code snippet helps?) Even untidy HTML has… issues with whitespace.