mirror of https://gitlab.com/bashrc2/epicyon
Add paragraphs
parent
4e72f36a1c
commit
ab62dcfe73
|
@ -1484,7 +1484,7 @@ def combine_textarea_lines(text: str) -> str:
|
|||
para = para.replace('\n', ' ')
|
||||
para = para.replace(' ', ' ')
|
||||
if ctr > 0:
|
||||
result += '\n\n'
|
||||
result += '</p><p>'
|
||||
result += para
|
||||
ctr += 1
|
||||
return result
|
||||
|
|
6
tests.py
6
tests.py
|
@ -7424,7 +7424,7 @@ def _test_combine_lines():
|
|||
assert result == expected
|
||||
|
||||
text = 'First line.\n\nSecond line.'
|
||||
expected = text
|
||||
expected = 'First line.</p><p>Second line.'
|
||||
result = combine_textarea_lines(text)
|
||||
if result != expected:
|
||||
print('expected: ' + expected)
|
||||
|
@ -7432,7 +7432,7 @@ def _test_combine_lines():
|
|||
assert result == expected
|
||||
|
||||
text = 'First\nline.\n\nSecond\nline.'
|
||||
expected = 'First line.\n\nSecond line.'
|
||||
expected = 'First line.</p><p>Second line.'
|
||||
result = combine_textarea_lines(text)
|
||||
if result != expected:
|
||||
print('expected: ' + expected)
|
||||
|
@ -7441,7 +7441,7 @@ def _test_combine_lines():
|
|||
|
||||
# with extra space
|
||||
text = 'First\nline.\n\nSecond \nline.'
|
||||
expected = 'First line.\n\nSecond line.'
|
||||
expected = 'First line.</p><p>Second line.'
|
||||
result = combine_textarea_lines(text)
|
||||
if result != expected:
|
||||
print('expected: ' + expected)
|
||||
|
|
Loading…
Reference in New Issue