summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2010-11-26 13:36:18 +0100
committerJan Holesovsky <kendy@suse.cz>2010-11-26 13:36:18 +0100
commit9524e3760230567daa574b2749f59ac5c5a16cef (patch)
tree56df1a56da53698b5bf108b513e508761471bf96
parent634e1e7ebd1658cc3aa9954eb5057ecdf12fefd1 (diff)
wikihelp: Improve the whitespace behavior in paragraphs.
-rwxr-xr-xhelpcontent2/to-wiki/wikiconv2.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/helpcontent2/to-wiki/wikiconv2.py b/helpcontent2/to-wiki/wikiconv2.py
index 1c7f253cbd..9d0e86fc6b 100755
--- a/helpcontent2/to-wiki/wikiconv2.py
+++ b/helpcontent2/to-wiki/wikiconv2.py
@@ -926,6 +926,11 @@ class Paragraph(ElementBase):
pass
def char_data(self, parser, data):
+ if self.role == 'paragraph' or self.role == 'heading':
+ if data != '' and data[0] == ' ':
+ data = ' ' + data.lstrip()
+ data = data.replace('\n', ' ')
+
if len(self.localized_objects):
return
loc_text = u''