From cad8e79a5f2b65538cb6c141674afc133c704c54 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Thu, 11 Jul 2024 11:56:52 +0200 Subject: [PATCH] doxygen xml parser: ignore empty strings --- doc/python/doxygen_xml_parser.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/python/doxygen_xml_parser.py b/doc/python/doxygen_xml_parser.py index ed43b13ac..ae5cdb428 100755 --- a/doc/python/doxygen_xml_parser.py +++ b/doc/python/doxygen_xml_parser.py @@ -2,10 +2,13 @@ # ruff: noqa: E501 from __future__ import print_function -from lxml import etree + +import sys from os import path + +from lxml import etree + from xml_docstring import XmlDocString -import sys template_file_header = """#ifndef DOXYGEN_AUTODOC_{header_guard} #define DOXYGEN_AUTODOC_{header_guard} @@ -163,7 +166,11 @@ def xmlToType(self, node, array=None, parentClass=None, tplargs=None): refid = c.attrib["refid"] if parentClass is not None and refid == parentClass.id: t += " " + parentClass.name - if c.tail is not None and c.tail.lstrip()[0] != "<": + if ( + c.tail is not None + and c.tail.strip() + and c.tail.lstrip()[0] != "<" + ): if tplargs is not None: t += tplargs elif (