parse_doxygen_xml: non-breaking space for types

Use non-breaking space for types in markdown tables to avoid line breaks

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
Gerwin Klein
2025-07-14 11:16:22 +10:00
parent d815b87ce5
commit f44f103c26

View File

@@ -503,9 +503,15 @@ Type | Name | Description
""" % param_string
return ""
def make_nbsp(self, string):
"""Make all spaces non-breaking"""
# Use unicode non-breaking space. HTML &nbsp; is not valid in all Markdown flavours.
return string.replace(" ", "\u00a0")
def generate_param_string(self, param_info, param_name):
return "`%(type)s` | `%(name)s` | %(desc)s\n" % {
"type": self.get_text(param_info["type"], escape=False),
"type": self.make_nbsp(self.get_text(param_info["type"], escape=False)),
"name": self.get_text(param_name, escape=False),
"desc": self.todo_if_empty(param_info.get("desc", "").strip()),
}