mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-04 20:59:21 +02:00
codegen: Do not add extra paragraph elements while parsing
When parsing a comment we're adding <para> elements ourselves, but the DocBook generator already wraps any block of text that does not start with a <para> element with one.
This commit is contained in:
@@ -345,9 +345,17 @@ class DocbookCodeGenerator:
|
||||
|
||||
def expand_paras(self, s, expandParamsAndConstants):
|
||||
s = self.expand(s, expandParamsAndConstants).strip()
|
||||
res = []
|
||||
if not s.startswith("<para"):
|
||||
s = "<para>%s</para>" % s
|
||||
return s
|
||||
res.append("<para>")
|
||||
for line in s.split("\n"):
|
||||
line = line.strip()
|
||||
if not line:
|
||||
line = "</para><para>"
|
||||
res.append(line)
|
||||
if not s.endswith("</para>"):
|
||||
res.append("</para>")
|
||||
return "\n".join(res)
|
||||
|
||||
def generate_expand_dicts(self):
|
||||
self.expand_member_dict = {}
|
||||
|
Reference in New Issue
Block a user