summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhelpcontent2/to-wiki/wikiconv2.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/helpcontent2/to-wiki/wikiconv2.py b/helpcontent2/to-wiki/wikiconv2.py
index 74b3f31362..a2acb9424e 100755
--- a/helpcontent2/to-wiki/wikiconv2.py
+++ b/helpcontent2/to-wiki/wikiconv2.py
@@ -1048,30 +1048,31 @@ class Paragraph(ElementBase):
else:
role = 'tablenextpara'
- # prepend the markup according to the role
- text = ''
- if len(self.objects) > 0:
- try:
- text = text + replace_paragraph_role['start'][role]
- except:
- sys.stderr.write( "Unknown paragraph role start: " + role + "\n" )
-
# the text itself
children = ElementBase.get_all(self)
if self.role != 'emph':
children = children.strip()
+ if len(children) == 0:
+ return ''
+
+ # prepend the markup according to the role
+ text = ''
+ try:
+ text = text + replace_paragraph_role['start'][role]
+ except:
+ sys.stderr.write( "Unknown paragraph role start: " + role + "\n" )
+
if replace_paragraph_role['templ'][role]:
text = text + escape_equals_sign(children)
else:
text = text + children
# append the markup according to the role
- if len(self.objects) > 0:
- try:
- text = text + replace_paragraph_role['end'][role]
- except:
- sys.stderr.write( "Unknown paragraph role end: " + role + "\n" )
+ try:
+ text = text + replace_paragraph_role['end'][role]
+ except:
+ sys.stderr.write( "Unknown paragraph role end: " + role + "\n" )
return text