diff options
author | Jan Holesovsky <kendy@suse.cz> | 2010-12-10 23:30:55 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2010-12-10 23:30:55 +0100 |
commit | 34a58287efe597e2c007ebc47976929884ed60f7 (patch) | |
tree | 6ddaaf97f9e6e15bbe648722d5e87c2589bc0b7e /helpcontent2 | |
parent | 2f34dd4260eea803634371a9bea6cdf3689ca450 (diff) |
wikihelp: Avoid unnecessary empty lines (causing additional paragraphs).
Diffstat (limited to 'helpcontent2')
-rwxr-xr-x | helpcontent2/to-wiki/wikiconv2.py | 27 |
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 |