Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 88e0b49
Author: arjoonn sharma <arjoonn.94@gmail.com>
Date:   Tue Jun 22 22:14:44 2021 +0530

    fix newline bug

commit 820b779
Author: arjoonn sharma <arjoonn.94@gmail.com>
Date:   Tue Jun 22 21:32:44 2021 +0530

    add failing test
  • Loading branch information
theSage21 authored and Alir3z4 committed Dec 22, 2023
1 parent 8c4f446 commit 1059fef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions html2text/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def feed(self, data: str) -> None:
super().feed(data)

def handle(self, data: str) -> str:
self.start = True
self.feed(data)
self.feed("")
markdown = self.optwrap(self.finish())
Expand Down
12 changes: 12 additions & 0 deletions test/test_newlines_on_multiple_calls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import html2text

# See https://github.com/Alir3z4/html2text/issues/163 for more information.


def test_newline_on_multiple_calls():
h = html2text.HTML2Text()
html = "<p>test</p>"
md1 = h.handle(html)
md2 = h.handle(html)
md3 = h.handle(html)
assert md1 == md2 == md3

0 comments on commit 1059fef

Please sign in to comment.