[gtk-doc] mkhtml2: handle ulinks without link text



commit dcda49abb583f0742db8952a2a077581ab69416a
Author: Stefan Sauer <ensonic users sf net>
Date:   Sat Apr 28 13:37:37 2018 +0200

    mkhtml2: handle ulinks without link text
    
    Those use the link again.

 gtkdoc/mkhtml2.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtkdoc/mkhtml2.py b/gtkdoc/mkhtml2.py
index bece117..da59d9c 100644
--- a/gtkdoc/mkhtml2.py
+++ b/gtkdoc/mkhtml2.py
@@ -906,7 +906,11 @@ def convert_title(ctx, xml):
 
 
 def convert_ulink(ctx, xml):
-    result = ['<a class="%s" href="%s">%s</a>' % (xml.tag, xml.attrib['url'], xml.text)]
+    if xml.text:
+        result = ['<a class="%s" href="%s">%s</a>' % (xml.tag, xml.attrib['url'], xml.text)]
+    else:
+        url = xml.attrib['url']
+        result = ['<a class="%s" href="%s">%s</a>' % (xml.tag, url, url)]
     append_text(xml.tail, result)
     return result
 


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