python-markdownify icon indicating copy to clipboard operation
python-markdownify copied to clipboard

Tidy HTML breaks result

Open nachitox opened this issue 2 years ago • 2 comments

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.

nachitox avatar May 29 '23 16:05 nachitox

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

5yato4ok avatar May 30 '23 17:05 5yato4ok

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.

mirabilos avatar May 30 '23 22:05 mirabilos