From 3c9f8bf906e23e3f14900b95ee9b4ff3b534150d Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Mon, 13 Oct 2025 12:45:24 +0200 Subject: [PATCH 1/5] fix: ``_nolinebreak`` rendering --- src/pyconverter/xml2py/ast_tree.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pyconverter/xml2py/ast_tree.py b/src/pyconverter/xml2py/ast_tree.py index 8e39ee7dc..d978b2a6a 100644 --- a/src/pyconverter/xml2py/ast_tree.py +++ b/src/pyconverter/xml2py/ast_tree.py @@ -54,6 +54,7 @@ "Caret 40?": "", '``"``': "``", "/_nolinebreak?": "", + "_nolinebreak ?": "", "_nolinebreak?": "", "nbsp": " ", } From 8278e4d6a5864191f6dcd3dfeba976766725503c Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Tue, 14 Oct 2025 15:22:20 +0200 Subject: [PATCH 2/5] feat: clean up --- src/pyconverter/xml2py/ast_tree.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pyconverter/xml2py/ast_tree.py b/src/pyconverter/xml2py/ast_tree.py index d978b2a6a..1244b5aea 100644 --- a/src/pyconverter/xml2py/ast_tree.py +++ b/src/pyconverter/xml2py/ast_tree.py @@ -54,8 +54,7 @@ "Caret 40?": "", '``"``': "``", "/_nolinebreak?": "", - "_nolinebreak ?": "", - "_nolinebreak?": "", + "/_nolinebreak ?": "", "nbsp": " ", } From f76aabed71e6b80c84ffa628ed4f1977a45166c7 Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Tue, 14 Oct 2025 15:31:28 +0200 Subject: [PATCH 3/5] fix: ``_nolinebreak`` rendering - 2 --- src/pyconverter/xml2py/ast_tree.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pyconverter/xml2py/ast_tree.py b/src/pyconverter/xml2py/ast_tree.py index 1244b5aea..9f4d9b05b 100644 --- a/src/pyconverter/xml2py/ast_tree.py +++ b/src/pyconverter/xml2py/ast_tree.py @@ -55,6 +55,8 @@ '``"``': "``", "/_nolinebreak?": "", "/_nolinebreak ?": "", + "_nolinebreak?": "", + "_nolinebreak ?": "", "nbsp": " ", } From ccbb8cac046b1c40b6a56f1b7e1e3e45ebca3c95 Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Thu, 16 Oct 2025 15:14:15 +0200 Subject: [PATCH 4/5] fix: ``tbft``command --- src/pyconverter/xml2py/ast_tree.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/pyconverter/xml2py/ast_tree.py b/src/pyconverter/xml2py/ast_tree.py index 9f4d9b05b..1122e1e11 100644 --- a/src/pyconverter/xml2py/ast_tree.py +++ b/src/pyconverter/xml2py/ast_tree.py @@ -3087,7 +3087,21 @@ def arg_desc(self) -> List[Argument]: refsyn = self.rec_find("Refsynopsisdiv") # search by ID arguments = None - if refsyn is None: + if refsyn and "Variablelist" in refsyn.children_types: + for elem in refsyn: + if isinstance(elem, Variablelist): + if arguments is None: + arguments = ArgumentList( + self.py_name, self.url, self._terms, elem, self.args + ) + else: + arguments += ArgumentList( + self.py_name, self.url, self._terms, elem, self.args + ) + if isinstance(elem, Paragraph): + self._is_paragraph_in_arg_desc = True + + else: refsections = self.find_all("RefSection") for elem in refsections: for child in elem: @@ -3103,20 +3117,6 @@ def arg_desc(self) -> List[Argument]: if isinstance(child, Paragraph): self._is_paragraph_in_arg_desc = True - else: - for elem in refsyn: - if isinstance(elem, Variablelist): - if arguments is None: - arguments = ArgumentList( - self.py_name, self.url, self._terms, elem, self.args - ) - else: - arguments += ArgumentList( - self.py_name, self.url, self._terms, elem, self.args - ) - if isinstance(elem, Paragraph): - self._is_paragraph_in_arg_desc = True - arg_file = Path("args.txt") if arguments is not None: From 73cab27e403e91757e605ecba29fb3ba97b7a5cb Mon Sep 17 00:00:00 2001 From: clatapie <78221213+clatapie@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:25:20 +0200 Subject: [PATCH 5/5] fix: ``an3d``, ``list``, ``macopt`` and ``pri2`` arguments --- src/pyconverter/xml2py/ast_tree.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/pyconverter/xml2py/ast_tree.py b/src/pyconverter/xml2py/ast_tree.py index 1122e1e11..e03496da8 100644 --- a/src/pyconverter/xml2py/ast_tree.py +++ b/src/pyconverter/xml2py/ast_tree.py @@ -698,7 +698,7 @@ def find(self, _type, terms=None): """Find the first type matching a given type string.""" for item in self: if type(item).__name__ == _type: - if _type == "Refname" or _type == "Refnamediv": + if _type == "Refname": if terms == None: logging.error("ERROR: terms are not defined for a 'Refname' class.") item.terms = terms @@ -710,7 +710,9 @@ def find_all(self, _type, recursive=False, terms=None): items = [] for item in self: if type(item).__name__ == _type: - if _type == "Refname" or _type == "Refnamediv": + if _type == "Refname": + if not terms: + logging.error("ERROR: terms are not defined for a 'Refname' class.") item.terms = terms items.append(item) elif recursive and isinstance(item, Element): @@ -3117,6 +3119,15 @@ def arg_desc(self) -> List[Argument]: if isinstance(child, Paragraph): self._is_paragraph_in_arg_desc = True + # Check whether arguments have been caught + if not arguments: + refnamediv = self.find("Refnamediv") + available_arguments = refnamediv[0].get_children_by_type("Replaceable") + if available_arguments: + arguments = ArgumentList( + self.py_name, self.url, self._terms, available_arguments, self.args + ) + arg_file = Path("args.txt") if arguments is not None: