[gtk-doc] mkhtml: handle comments correctly
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] mkhtml: handle comments correctly
- Date: Fri, 30 Mar 2018 18:55:44 +0000 (UTC)
commit 78fc71abfc444264d4e2b7c2fbfb8ae311c0d64a
Author: LRN <lrn1986 gmail com>
Date: Fri Mar 30 20:52:03 2018 +0200
mkhtml: handle comments correctly
Since etree._Comment has no .tag attribute, just pass the comment through.
gtkdoc/mkhtml2.py | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/gtkdoc/mkhtml2.py b/gtkdoc/mkhtml2.py
index 5f8e7fe..b9c3921 100644
--- a/gtkdoc/mkhtml2.py
+++ b/gtkdoc/mkhtml2.py
@@ -270,14 +270,17 @@ def convert__unknown(ctx, xml):
# don't recurse on subchunks
if xml.tag in CHUNK_TAGS:
return []
- # warn only once
- if xml.tag not in missing_tags:
- logging.warning('Add tag converter for "%s"', xml.tag)
- missing_tags[xml.tag] = True
- result = ['<!-- ' + xml.tag + '-->\n']
- convert_inner(ctx, xml, result)
- result.append('<!-- /' + xml.tag + '-->\n')
- return result
+ if isinstance(xml, etree._Comment):
+ return ['<!-- ' + xml.text + '-->\n']
+ else:
+ # warn only once
+ if xml.tag not in missing_tags:
+ logging.warning('Add tag converter for "%s"', xml.tag)
+ missing_tags[xml.tag] = True
+ result = ['<!-- ' + xml.tag + '-->\n']
+ convert_inner(ctx, xml, result)
+ result.append('<!-- /' + xml.tag + '-->\n')
+ return result
def convert_refsect(ctx, xml, h_tag, inner_func=convert_inner):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]