From 9be25ceb9a05934032899316de38d311a2d7ebbc Mon Sep 17 00:00:00 2001 From: Jorge Marques Date: Fri, 20 Dec 2024 16:20:32 -0300 Subject: [PATCH] __init__: Skip Text node for unique id The text node seems to have a different class format that causes issues with ids. Signed-off-by: Jorge Marques --- adi_doctools/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adi_doctools/__init__.py b/adi_doctools/__init__.py index f09c164..2bace4c 100644 --- a/adi_doctools/__init__.py +++ b/adi_doctools/__init__.py @@ -158,7 +158,8 @@ def make_unique_id(node, id_): # and deprecates traverse (returns a list). # Sphinx 7.1.2 requires Docutils >= 0.18.1 for node in self.document.findall(): - if 'ids' in node and node['ids']: + if (not isinstance(node, nodes.Text) and + 'ids' in node and node['ids']): make_unique_id(node, node['ids'][0])