Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion markdownify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ def convert_p(self, el, text, parent_tags):
new_lines = []
for line in lines:
line = line.lstrip(' \t\r\n')
line_no_trailing = line.rstrip()
line_no_trailing = line.rstrip(' \t\r\n')
trailing = line[len(line_no_trailing):]
line = fill(line,
width=self.options['wrap_width'],
Expand Down
1 change: 1 addition & 0 deletions tests/test_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ def test_p():
assert md('<p>1234 5678 9012<br />67890</p>', wrap=True, wrap_width=10, newline_style=SPACES) == '\n\n1234 5678\n9012 \n67890\n\n'
assert md('First<p>Second</p><p>Third</p>Fourth') == 'First\n\nSecond\n\nThird\n\nFourth'
assert md('<p>&nbsp;x y</p>', wrap=True, wrap_width=80) == '\n\n\u00a0x y\n\n'
assert md('<p>x y&nbsp;<br>z</p>', wrap=True, wrap_width=80, newline_style=SPACES) == md('<p>x y&nbsp;<br>z</p>', newline_style=SPACES) == '\n\nx y\u00a0 \nz\n\n'


def test_pre():
Expand Down