[gtk-doc] mkhtml2: fix bookinfo with no onlineurl



commit d3a36cd9e81cbe069ba27629fe77ba948741ebdd
Author: Stefan Sauer <ensonic users sf net>
Date:   Mon Feb 11 21:43:48 2019 +0100

    mkhtml2: fix bookinfo with no onlineurl

 gtkdoc/mkhtml2.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtkdoc/mkhtml2.py b/gtkdoc/mkhtml2.py
index ed1d48f..945bfd4 100644
--- a/gtkdoc/mkhtml2.py
+++ b/gtkdoc/mkhtml2.py
@@ -1707,9 +1707,9 @@ def create_devhelp2_content(module, xml, files):
     if len(bookinfo_nodes):
         bookinfo = bookinfo_nodes[0]
         title = bookinfo.xpath('./title/text()')[0]
-        online_url = bookinfo.xpath('./releaseinfo/ulink[@role="online-location"]/@url')[0]
-        if online_url:
-            online_attr = ' online="' + online_url + '"'
+        online_url = bookinfo.xpath('./releaseinfo/ulink[@role="online-location"]/@url')
+        if len(online_url):
+            online_attr = ' online="' + online_url[0] + '"'
         # TODO: support author too (see devhelp2.xsl), it is hardly used though
         # locate *.devhelp2 | xargs grep -Hn --color ' author="[^"]'
     # TODO: fixxref uses '--src-lang' to set the language, we have this in options too


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]