From 6b7137994a5bd970773bbb2b73719f9573936b26 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Tue, 12 Jun 2007 18:12:19 +0000 Subject: [PATCH] Fix potential exception in soup2html. - Legacy-Id: 340 --- ietf/utils/soup2text.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ietf/utils/soup2text.py b/ietf/utils/soup2text.py index 28e11d862..75763649b 100755 --- a/ietf/utils/soup2text.py +++ b/ietf/utils/soup2text.py @@ -87,10 +87,9 @@ def render(node, encoding='latin-1', pre=False): blocks.append(child.text+"\n\n") node.is_block = True else: - if child.text: - if child.name in space_tags and not words[-1][-1] in [" ", "\t", "\n"]: - words.append(" ") - words.append(child.text) + if child.name in space_tags and not (words[-1] and words[-1][-1] in [" ", "\t", "\n"]): + words.append(" ") + words.append(child.text) else: raise ValueError("Unexpected node type: '%s'" % child) if words: