diff --git a/gio/gdbus-2.0/codegen/codegen_docbook.py b/gio/gdbus-2.0/codegen/codegen_docbook.py
index bca17c7a7..94e07ed49 100644
--- a/gio/gdbus-2.0/codegen/codegen_docbook.py
+++ b/gio/gdbus-2.0/codegen/codegen_docbook.py
@@ -172,18 +172,18 @@ class DocbookCodeGenerator:
self.out.write('\n')
self.print_method_prototype(i, m, in_synopsis=False)
self.out.write('\n')
- self.out.write('%s\n'%(self.expand(m.doc_string, True)))
+ self.out.write('%s\n'%(self.expand_paras(m.doc_string, True)))
if m.in_args or m.out_args:
self.out.write('\n')
for a in m.in_args:
self.out.write('\n'%())
self.out.write(' IN %s %s:\n'%(a.signature, a.name))
- self.out.write(' %s\n'%(self.expand(a.doc_string, True)))
+ self.out.write(' %s\n'%(self.expand_paras(a.doc_string, True)))
self.out.write('\n'%())
for a in m.out_args:
self.out.write('\n'%())
self.out.write(' OUT %s %s:\n'%(a.signature, a.name))
- self.out.write(' %s\n'%(self.expand(a.doc_string, True)))
+ self.out.write(' %s\n'%(self.expand_paras(a.doc_string, True)))
self.out.write('\n'%())
self.out.write('\n')
if len(m.since) > 0:
@@ -199,13 +199,13 @@ class DocbookCodeGenerator:
self.out.write('\n')
self.print_signal_prototype(i, s, in_synopsis=False)
self.out.write('\n')
- self.out.write('%s\n'%(self.expand(s.doc_string, True)))
+ self.out.write('%s\n'%(self.expand_paras(s.doc_string, True)))
if s.args:
self.out.write('\n')
for a in s.args:
self.out.write('\n'%())
self.out.write(' %s %s:\n'%(a.signature, a.name))
- self.out.write(' %s\n'%(self.expand(a.doc_string, True)))
+ self.out.write(' %s\n'%(self.expand_paras(a.doc_string, True)))
self.out.write('\n'%())
self.out.write('\n')
if len(s.since) > 0:
@@ -221,7 +221,7 @@ class DocbookCodeGenerator:
self.out.write('\n')
self.print_property_prototype(i, p, in_synopsis=False)
self.out.write('\n')
- self.out.write('%s\n'%(self.expand(p.doc_string, True)))
+ self.out.write('%s\n'%(self.expand_paras(p.doc_string, True)))
if len(p.since) > 0:
self.out.write('Since %s\n'%(p.since))
if p.deprecated:
@@ -240,6 +240,12 @@ class DocbookCodeGenerator:
s = re.sub('%[a-zA-Z0-9_]*', lambda m: '' + m.group(0)[1:] + '', s)
return s
+ def expand_paras(self, s, expandParamsAndConstants):
+ s = self.expand(s, expandParamsAndConstants).strip()
+ if not s.startswith("\n'%(utils.dots_to_hyphens(i.name)))
self.out.write(' Description\n'%())
- self.out.write(' %s\n'%(self.expand(i.doc_string, True)))
+ self.out.write(' %s\n'%(self.expand_paras(i.doc_string, True)))
if len(i.since) > 0:
self.out.write(' Since %s\n'%(i.since))
if i.deprecated: