Skip to content

Commit 541b041

Browse files
committed
soup2html() tweak to better avoid indentation at paragraph start.
- Legacy-Id: 329
1 parent 67eb998 commit 541b041

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ietf/utils/soup2text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def para(words, pre):
4343
text = "".join(words)
4444
text = unescape(text)
4545
if not pre:
46-
text = re.sub("[\r\n\t ]+", " ", text)
46+
text = re.sub("[\r\n\t ]+", " ", text.strip())
4747
text = textwrap.fill(text)
4848
return text
4949

@@ -99,7 +99,7 @@ def __str__(self, encoding='latin-1',
9999
node = render(self, encoding)
100100
str = node.text
101101
str = re.sub("[ \t]+", " ", str)
102-
str = re.sub("\n\n+ *", "\n\n", str)
102+
str = re.sub("\n\n+", "\n\n", str)
103103
return str
104104

105105
def soup2text(html):

0 commit comments

Comments
 (0)