Skip to content

Commit

Permalink
Strip trailing line from beautifulsoup prettify output
Browse files Browse the repository at this point in the history
From beautifulsoup version 4.12.1 (20230405):
* Tag.prettify() will now consistently end prettified markup with
  a newline.

https://git.launchpad.net/beautifulsoup/tree/CHANGELOG
  • Loading branch information
francoisfreitag committed Apr 26, 2023
1 parent ac54915 commit d52b6ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
django.setup()

def print_html(html):
print(BeautifulSoup(html).prettify())
print(BeautifulSoup(html).prettify().strip())


The PhoneNumber wrapper
Expand Down

0 comments on commit d52b6ec

Please sign in to comment.