[gtk-doc] mkhtml2: handle deprecated without description keywords for devhelp2
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] mkhtml2: handle deprecated without description keywords for devhelp2
- Date: Fri, 30 Mar 2018 19:12:25 +0000 (UTC)
commit 37526398947a65acb39c4051603672c45afe4c97
Author: LRN <lrn1986 gmail com>
Date: Fri Mar 30 21:05:59 2018 +0200
mkhtml2: handle deprecated without description keywords for devhelp2
If there is no value, split() returns 1-element list.
See https://bugzilla.gnome.org/show_bug.cgi?id=788911
gtkdoc/mkhtml2.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gtkdoc/mkhtml2.py b/gtkdoc/mkhtml2.py
index b9c3921..a6d4b43 100644
--- a/gtkdoc/mkhtml2.py
+++ b/gtkdoc/mkhtml2.py
@@ -1151,7 +1151,14 @@ def create_devhelp2_condition_attribs(node):
if 'condition' in node.attrib:
# condition -> since, deprecated, ... (separated with '|')
cond = node.attrib['condition'].replace('"', '"').split('|')
- return' ' + ' '.join(['%s="%s"' % tuple(c.split(':', 1)) for c in cond])
+ keywords = []
+ for c in cond:
+ if ':' in c:
+ keywords.append('{}="{}"'.format(*c.split(':', 1)))
+ else:
+ # deprecated can have no description
+ keywords.append('{}="{}"'.format(c, ''))
+ return ' ' + ' '.join(keywords)
else:
return ''
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]